Well you have to consider the people in the jails
If you are in a County Jail, and are in there for a minor defense, most the guys in there will have girlfriends and wives and aren't like that. They can wait a few months and just beat off.
On the other hand, in Federal or State penitentionary's, where guys are in there for YEARS, it's a different story. They have nothing to come home to, usually just switch teams, and resort to faggotry. They have to release sexual tension somehow.
You'll be straight if caught for DUI or Possession. Just don't kill nobody or commit any major felonies and you probably won't get ass raped.
I also agree with Redzulu - giving it is more gay than taking it. In the traditional sense of gay relationships the more feminine guy is on the bottom, and is therefore more gay, but he ENJOYS it.
If you don't enjoy it, but if you are forced take it rather than being seriously hurt you are not in any way a homosexual. However if you put your dick in another guy's ass, you are.
I was in a military school for an entire year, and admit after being surrounded by guys and never questioned my sexuality. Most of the time when we saw a girl, we would go buck fucking wild and our hearts would race and we'd get excited as fuck. I even fantasized about fucking my female teachers in their 30's, one of em had a really nice ass, but flat as hell. And another with huge tits, but ugly in the face. Didn't stop me from winking and whistling at them.
However in this school in was very looked down upon to be gay, it was warrant for ass beatings and humiliation. I think because it was common for some guys to do whatever with each other sometime, a few people got caught, especially the middle schoolers just hitting puberty.