While nothing definitive can be determined, I would say "yes they could probably do it" - as a guess, and "no", the show clearly implies that a woman is the more logical choice. The dialogue implies that a man carrying a child would not be a first choice. That doesn't mean it "couldn't" be done only that it wouldn't be considered if are female options.
That said, it can be read either way that Bashir is the doctor, he couldn't perform surgery on himself" and, "he's a man so he's not an option", but while both are probably true, I think the second is the primary point in the conversation.
The conversation is with Captain Sisko after they return, O'Brien is there too, to interject a few "whats", but it's basically a conversation with Sisko.
BASHIR: Kira almost had us clear of the asteroid field, and then the
deflectors became overwhelmed. We were side-swiped by a rock the size
of this room. A fuel pod exploded and Keiko was thrown against the
bulkhead. She had a concussion, broken ribs, internal haemorrhaging. I
managed to stabilise her but the baby's autonomic functions were
failing. I had to find another womb for the baby, and the only two
people available were Major Kira and me.
SISKO: I think you made the right choice, Doctor.
O'BRIEN: But the Major's Bajoran. How can she carry a human child?
BASHIR: I had to stimulate Kira's estrogen and progesterone
production, and administer high doses of tesokine to enable the baby
to metabolise Bajoran nutrients.
SISKO: But the bottom line is it worked, right?
O'BRIEN: So, when will Keiko will be strong enough to take the baby
BASHIR: Well, Keiko should be up on her feet in a day or two.
However, the baby
BASHIR: Major Kira will have to carry the baby to term. You see,
Chief, Bajoran women carry their children for less than five months.
Because they have such a short gestation period, they vascularise very
quickly. Mother and child form a complex interconnecting network of
blood vessels. In order to transfer the baby back to Keiko, I would
have to sever those ties, which would likely cause massive internal
haemorrhage in Kira and a severe respiratory trauma for the baby.
O'BRIEN: So, what you're telling me is that Major Kira's going to have
This all sounds like typical Startrek banter/sarcasm to me. "The only people available were Kira and Me", meaning, both, he couldn't perform the surgery on himself and being a guy, he wasn't a good option.
This is confirmed by Sisko's "I think you made the right choice". Which to me implies, "women carry the babies", even in the 24th century.
That being said, it could be interpreted either way, but I think women carry the babies is the likely implication. I also see no reason why, given all their medical advancement, they couldn't do the surgery to enable a man to carry and give birth by giving the man the necessary organs to carry, if a guy really wanted that, so I think the technology could and probably does exist, but I think the implication of the show is that it's not the ideal choice. Women are better at it, even a woman from another species, so Kira was the obvious choice because she's a woman.