Yes you can legally be forced into a care home against your will if you're deemed a danger to yourself or to others.
If for example your health is really bad and you're unable to care for yourself or you may present a danger to someone or yourself then a family member can go to court and get a court order to have you forced into a care home.
Then the police can show up at your door and legally remove you from your home and take you to a care home.
That happened to my grandpa when he got dementia really bad and was an actual threat to anyone around him.
It was sad that it had to be done but that's all that could be done for his best interest and his family.
But for me I'll take myself out of this world before I got to a point where I could be forced into a care home.