Yes there are dementia wards that are locked. There are even specialized memory care facilities where the front entrance is kept locked and you need a code to get in. Ive done therapy dog visits in several types of this environment because I worked with alot of end stage alzheimers and dementia patients on hospice