If a monster lives up to the law for a certain city, would they be allowed to live in it? I'm not talking about basic monsters like orcs and goblinoids, or shape-shifters (including dragons), but more like liches, mind flayers, beholders, and other intelligent yet scary monsters. It doesn't matter if they are feared or accepted, just is it plausible to say they could live inside a town or city?
In the lore, there are examples of monsters living in towns
The Xanathar was one of the most infamous beholders of the Realms and the crime lord of the Xanathar Thieves' Guild in Skullport.
Nihiloor was a mind flayer who worked for the Xanathar's Thieves' Guild in the late 15th century DR, by creating and spreading intellect devourers throughout the sewers of Waterdeep.
Manxam was the oldest and most powerful beholder living in the Western Heartlands. He was a member of the Zhentarim, and also acted also as the ruler of Teshwave
Methil El-Viddenvelp was an illithid from Phanlinksal who served Yvonnel Baenre, and later Quenthel Baenre, as a secret advisor in the drow city of Menzoberranzan
Other creatures could live in cities, either openly or in secret. Perhaps the city is itself evil and cosmopolitan, filled with all kinds of denizens. Then again, there are plenty of racist or monoethnic cities, even in real life, which make things hard for outsiders.