If you're in the United States, the answer is a resounding "No"No. Prisons are miserable death traps before and after the apocalypse.
And here's why... (cue music)
Besides the aforementioned murderers and rapists, prisons rely on a constant stream of resupply. Not to mention that the vast majority of prisons, in the US at least, are desperately overpopulated.
The population density in most US jails and prisons rivals major cities as far as people per square mile/km.
And then there's the resupply problem. Yes a prison offers a nice castle, but what is a castle without food and fresh water? It's an expensive tomb.
Also... Modern prisons rely on electricity to maintain security. Gates, cells, and passageway doors are often magnetically sealed. No power and the doors no longer work.
Although most prisons will likely have a very nice storeroom, generators, and weapons; you can expect these places to either be ground zero, or much less fortunatelyfortunatly some of the last holdouts for paranoid, half trained, and well armed corrections officers.
Correction Officers in the United StatesCO's are a very special kind of cruel. Not all of them, of course, but the U.S. Prison system is structured in a way that promotes a culture of abuse and neglect towards inmates.
"Would you like to work in an environment where the vast majority of people would like to kill and/or rape you? Well we have a job opportunity for someone with your particular indifference to human suffering!"