Yes. You can open an HSA at any point so long as you meet the HSA eligibility requirements.
If you become eligible for an HSA on or before December 1 of the current year, you qualify for the full annual contribution limit. If it’s December 2 or later, though, you’ll only be eligible for a prorated amount under the Last Month Rule.
Additionally, if you lose your HDHP coverage part way, the IRS form 8889 has a worksheet that will help calculate how much you are eligible to contribute.
Source: "Publication 969 (2018), Health Savings Accounts and Other Tax-Favored Health Plans.”
Updated: