There are specific rules for prisons (as there are for theme parks and haunted houses.) They must have fire detection and a way to unlock if it is detected, and usually there must be someone monitoring the system whenever occupied and ready to enact emergency procedures.
Adding to that, there's special regulations for almost anything. Hotels, work sites, warehouses. The national fire code is quite a tome, and usually local rules are added on top