I've never been asked and I doubt that the small clinic I use would ask. The closest they have come was a questionnaire about symptoms of depression. The doctor said it sometimes is a problem for elderly men. A few years ago, in a hospital emergency room, I was asked if I was at risk for domestic violence. (The question may have been prompted by the fact that I had been hauled in after falling face first onto a sidewalk.) Surprised, I snorted, "Hell, no!"
If asked about gun ownership, I would reply in the affirmative. How the doctor replied would determine the subsequent direction of the conversation. It wouldn't bother me to be asked or reminded about storage and safe handling. On the other hand, if the response consisted of gun control claptrap, it could get ugly. I would systematically refute the doctor's anti-gun arguments and not back down. The doctor likely would learn more about the subject than he or she wanted to know.