To Pull the chain (alternatively Catch the chain) in the jargon of inmates is when you get transferred from one place to another, usually on a prison bus (sometimes referred to as a "chain", or "Bluebird express" (in Texas). The context I've heard it used most is when someone gets transferred from a temporary holding place (jail) to where they will do their real time (prison). I get the feeling it has a negative connotation of being forced to go somewhere against one's will and I don't think they use it when they get on the prison bus when they are being transferred for release.
I am not certain of the origin, but from what I've heard and read, it seems to come from the notion of a chain gang. Specifically when a guard wanted to move a bunch of inmates on a chain gang he would pull the chain they were attached to. Another possible (and less nostalgic) explanation is related to the fact that inmates are chained together when they are being transported on the bus.
The metaphor may be slightly different when you are being transferred from jail to prison. At least from the person I heard it from who was going through that process. It seemed more to me like he was likening the transfer to being flushed down a toilet, specifically referring to the old fashioned ones with a raised tank and flush chain. However, it is possible he just didn't know about the other origin and was assuming incorrectly.
Here are a couple of sources online for prison slang:
Prisoner's Dictionary (this is the best one)
The Correctional Officers Guide to Prison Slang
Texas Prison Slang Forum Posting
Thanks to my true-crime obsessed wife, I also can recommend the following book which is more exhaustive and frankly fascinating:
Prison-Ese: A Survivor's Guide to Speaking Prison Slang
You can probably get direct answers from people over at PrisonTalk.com if you have specific questions. It is a support forum for incarcerated people, their families and friends to help them cope with the experience.
Another of my favorites is a euphemism for getting charged with another crime when already in prison/jail. They call that catching a case. I like it because it so vividly demonstrates the mindset of persecution and lack of responsibility that is prevalent among criminals. That is, they get charged with a crime for the same people catch a disease, by being in the wrong place at the wrong time and not because of anything they may have done.
This is all second hand knowledge. I've never been to prison or jail personally. I just know a couple of people who have, or have family members currently in prison.
Also, prison slang seems to have regional dialects to some degree. So there might be slightly different terms or connotations in a Texas prison and an Illinois prison.