I'd say that even if the question wasn't in a bar/was asked later, it's still pretty offensive, unless the person has indicated to you that they want to talk about/intend to do certain types of medical transition. "pre" and "post" op imply that there is a single operation that is necessary to successfully "complete" transition, and that if someone is trans-identified, that is 100% what they will do.
Some people want to change their genitals, and some people don't, some people experience genital dysphoria, and some people don't, some people can afford surgeries, and some people can't, some people who desire surgeries are healthy enough to have them, and some people aren't. By asking that question in the way you've posed it, you're reducing the life and desirability of a trans person down to the most visible Oprah-style basic/invasive question that every stranger wants to know.
A better thing to do might be picking up an educational book on having sex with transgender people (there's several pretty good ones that can help you learn how to ask people respectful questions about how to talk about and engage with their body, and understand the different ways that bodies work, including things you may want to know about the effects of different kinds of medical transition, etc), and learn to be comfortable or at least respectful of the complexity and wonderful variety of human bodies that can go with any particular gender identity.