Bottom line: this kind of information might come naturally without someone having to ask for it and in that context it is totally fine.
Sorry english is not my native language so maybe I am not making it clear enough.
Do you think it would be okay to ask someone how many kittens they have stomped to death in the past? And, if the answer is greater than zero, to break off the relationship?
I don't care about ex partners. I'd rather know if my sexuality is compatible with that person and if that person is comfortable/confident with their sexual life.
Nobody's first question is "have you ever been a porn star" but it's going to come up eventually and, whether or not you care it will definitely be a deal breaker for many.
Or I don't know, maybe in your culture you have to wait months / years before considering a partner someone you are dating regularly / spending a significant part of your life with.