You're worried about deprivation of assets? The problem is that you can't sell an extension to pay for care, and it could be argued that they're using money which should be set aside for their care instead to enhance the value of your home. The penalty for deprivation of assets is that assumed to still hold the assets you got rid of - which means that social services would do the assessment as if your parent still had whatever sum they'd paid into the extension, and in practice, once their own funds had run out, you'd end up paying the shortfall. I would take an accountant's view.
As long as they're living there, there should be no problem, provided you can demonstrate that their money went into providing accommodation for them. You would be able to demonstrate that you were saving public money by enabling them to stay in their own home for longer.
How long would they be able to self-fund if they went into care? What would the financial situation be when they needed a social service contribution to a care home - would you by then be able to buy them out and release the money they'd put into the extension to pay for care home?
Could you get a mortgage to build the extension, charge your parent a fair market rate, and use that to pay off most of the mortgage? Then, if you needed to, get a lodger to continuing paying off the mortgage one your parent went into care. Lots of paperwork, insurance and tax implications. Last resort, I think.
It really depends how much of their money you need to pay for the extension. The average person survives about 3 years in a care home. Have they got enough money left to self-fund for 3 years?