My mother in-law who has advanced dementia has been in a home for over two years and it's the best place for her. She doesn't have a clue who any of her children are anymore and she is used to the routine in the home.
Most dementia patients are in care homes under medical recommendations as they can proves 24/7 care which is needed, the homes are also organised specifically for dementia care
Nobody is stopping you seeing them but depending on the state of the dementia it's mostly pointless as they don't have a clue who you are or what they doing
So someone who is now a unknown to the person in the care home coming in and taking her out of her safe space will be a very traumatic experience for someone with dementia, but as long as you can take mother home who cares at least you get your martyr badge