If you lose your job and have no money/house is it legal too camp out?

Was just wondering if you lost your job and also lost your home (reposessed) are there places where you are allowed to camp out in your tent. Or can you get free emergency housing or something similar. This question is hypothetical.
...............................................................................
You can't camp out for free - in the UK camping is banned at many public sites, and of course you would pay a fee to camp at many designated campgrounds.

However, a situation like this doesn't have to necessarily mean homelessness.

I know you say it is hypothetical but if this were to happen, your first step should be to contact your local authority. There are some people whom the local authority has an obligation to house, so if you fell into this category, then you would be given free accommodation in a bed-and-breakfast until a council flat could be found for you.

If the local authority were not obligated to house you, they would still be able to refer you to somewhere that could help such as a homeless shelter/hostel, where at least you would get a bed to sleep in each night.

Basically, in the UK now almost all local authorities consider preventing/eradicating homelessness to be a priority, and if you ask for help then you will almost always get it.
...............................................................................
yes it is called being homeless