At least in the UK attempts to gift money to relatives or sell a house to prevent it being sold to pay for social care is seen as "deprivation of assets" in a financial assessment.
There are laws in the U.S. which prevents someone from qualifying for full medicare benefits of, let's say for example, nursing home care. There is a 5 year look-back period to verify you haven't liquidated assets or you will be penalized.
I think in a lot of jurisdictions this is possible, but there are timing considerations. I know families who have moved significant majority of assets to children much earlier than any medical issues, partially as a hedge against this.