No. Since people in jail are not free and not able to have a life with another person, they are not allowed to register for marriage, unless they get leave permits from the jail.
(Shanghai.gov.cn October 17, 2006)