They can certainly go to the doctor - but in the vast majority of cases where men intermittently lose their erection, there is nothing at all the doctor is going to be able to do about that, and it will continue to make the use of condoms very difficult (and risky for the woman, because if they don't fit they're much more likely to tear or slip off).
Most men, absolutely, will be able to use condoms perfectly well. And as @ScaryM0nster said, if they're just trying to dodge barrier contraception, they'll make excuses about femidoms as well.
But for men who really are prone to loss/weakening of an erection, then a femidom would be a useful alternative barrier method.
Funny that most men can get an erection in their pants
That doesn't mean they can keep it for long enough to have sex, though.
Men's genitals are just as complicated and varied as ours are, you know.