The vast majority of medical workers are professional and can separate sex in situations that require patient nudity. I have never experienced any such comments and would be leery of a doctor, regardless of gender, who did and might even report them.
If one was to go by the untold posts and made-up stories here, it would be easy to think there is an epidemic of guys wanting to find any excuse to show off their dick, whether it be a medical exam or going to the bathroom, as well as bi-curious physicians complementing their johnsons: "Blood pressure is good. Your weight is where it should be. You seem to be paying good attention to your health. Oh, and your penis is a decent size as well. Congrats."