There is no guarantee. It's your risk. Sometimes places have been known to make exceptions to policies, but I certainly would not count on it.
This is one of many reasons that lots of people pay more and get hotel rooms
that can be canceled the 24 hours before (common policy for lots of tourist destinations) or by 6 p.m. the day of check in (I don't see that as often at tourist destinations). (I usually pay a higher rate for flexible cancelation if I am staying in a hotel and that's one of the rate options, so I can cancel on a dime when that's an option.). With lots of hotels with the 24 hour cancelation policy, the most you would be out would be paying for one night of your stay.
I do sometimes book condos, etc. where I would not be able to cancel last minute and would be out all or some of my money if I cancel within 30 days of the stay. Usually 30 days out I can get all my money back or all my money back less a nominal administrative fee. For these I types of situations, I am either prepared to take the risk (loose my money if something unexpected happens - self insure) or buy
travel insurance.
A cancel for any reason policy I have heard usually only covers 75% of your non-refundable expenses and usually costs about 10% of your non-refundable expenses to start. Protection isn't free. The costs have me self insuring in quite a few situations. For a trip with lots of expensive potential non-refundable expenses though, I might get the insurance. More and more places too offer insurance for individual non-refundable purchases.
Sites like "Insure by Trip" have good brokers who you can call and can help you pick out the kind of travel insurance you want and a policy.