Is the relationship possible to happen?
There are several relationships woven together in Kiss of the Spider Woman. It is possible for each of them to happen, but not likely for all of them to happen at once. In that way, the whole novel is like one of Molina's tales.
To expand on that a little bit, it is very possible for Valentin and Molina to have a sexual relationship. Same sex relationships are common when men are placed in isolation, even if they were heterosexual before this isolation. It is possible for Valentin and Molina to start off not understanding one another, and to come to understand one another better. It is possible for a Marxist revolutionary to better understand the purpose of fantastic stories (escapism) when he's locked up. However, for them all to happen together, and for the genuine love to blossom that does, is unlikely. Not impossible, but statistically unlikely.
Yes, the two homosexual prisoners, Molina and Valentin, both whom were opposite in thousands of ways, forged a close and intimate bond in their cell, and their sex relationship to each other improved as they progressed ahead, blossoming into true love, where they need each other to survive in the Nazi regime.