A lawsuit filed by a female prisoner who had a sexual relationship with a male guard that produced a child has raised the question of whether an inmate is legally capable of exercising consent.