Our club played inmates in Saughton prison once. One of the Officers was a member of a local club and wanted to promote the game. It was all very civilised, security checks etc... Don't know if it would be allowed nowadays.
On this side of the pond, at least, it would depend on the prison. Some are more severe than others. And each can have its own specific rules, though I can't see why chess would be much of a problem. Prisons in the UK might be more standardized.
As for the thread starter's question. I take it chess is fairly popular in prisons. My parents have a friend who spent 12 years in the federal prison system. He played chess as much as he could there, though he was playing chess long before he ever went to prison. He and my dad used to play often back in the day. In fact he once gifted my parents with a soapstone set he bought in Korea while he was stationed there in the early 1970s (the same set my dad taught me the game on, and the he recently gave to me :) ).
How popular is chess in prison? I watch a lot of prison and jail documentaries and it seems there are always a bunch of dudes playing chess. from your gangliest looking nerd to your most ripped out buff dude with full sleeves and all that. Is it all just for show for the documentaries? I know that they do have chess clubs on prison, but are they as big as documentaries make them seem? Ironically with all my tattoos (partial sleeves on both arks a chest piece and one that takes up the whole side of my neck I have had people ask me if I learned to play chess in prison both IRL and online. Are there any chess.com members who have been to prison and played or learn to play chess in prison?