Of course you can measure pain despite everyone feeling it differently. First, We can define pain by measuring the reaction of pain receptors in one’s body.
Then, we’d obtain our sample from willing individuals. And since such a study would require two large random samples, one of men and one of women, the subjectivity between each individual would be effectively negated by said random selection. Then, through statistical analysis, one would be able to find the answer.
That was a rather abridged way of explaining how it could be done, though. I can be more detailed in my next reply if you’d like