Not really going to happen in a real physical examination is it, unless the doctor is doing some off the wall study into penis size or other. If it were to be the case you would be invited to join the study in the first place and not have it dropped on you in the middle of a normal physical examination.
In the realm of fantasy it is something that I am sure some would find exciting, I have for some years included it in a fantasy of my own which developed from the one and only medical examination I had in my life when in the UK. A pre-university medical conducted by my local authority doctor who was an elderly (well seems that to me at 19 years of age at the time) lady forms the basis for the fantasy.
In the real examination she had me undress to my underpants ("Y" fronts in those days) and conducted a routine and relatively brief examination which included a quick feel for the hernia but no examination or visual of my genitals. The fantasy goes much further in which she suggests a more thorough examination at her own practice later in the week. After arriving at the due time I enter her office and we discuss the previous examination and what the current one will entail. She then asks me to go into the adjoining room which is the examination room, and to get undressed and to then return to her office. As I come through the door in just my underpants she looks up and says, "could you take your pants off as well please as this is a far more thorough examination".
After taking them off I walk into her office naked and she looks me up and down and then says we are going to check you eye sight; and then weight followed by height and other measurements. Completing all of the more normal parts she then begins to take measurements with a tape measure of my chest; waist; arm length and span followed by inside leg. She then says she will be taking measurements of my penis and scrotum and asks me to lift my penis while she takes the width and other dimensions of my scrotum.
The doctor then takes my flaccid penis from my own hand and placed the tape along from the upper base of my penis and to the tip, and then repeats the same from the underside. She then measures the circumference of the shaft and the glans. She then smiles and says that now measurements need to be taken of my penis when it is fully erect, to which I very naively ask how I am I going to get it erect. Her reply is very matter of fact, "how do you normally get yourself aroused". I say that I play with my penis thinking about naked women to which she says "well then off you go", and that did I want her to leave the room for minute or stay. I ask her to stay which seems to please her especially as i begin to stroke my penis which more or less immediately bring it to full attention.
The doctor then tells me to stop playing and repeats the measurement process as done with my dormant organ earlier. For me it is the fact that she handles my erect penis while doing the measurements which is the biggest part of the fantasy along with her being present while I masturbated.
This is of course pure fantasy which will never ever be realised in a real life situation, but just one of my somewhat tame fantasies.