Yes, on two occasions, but a very long time ago, both in France.
1. In the early 1960's, I was then a very young boy, 6 or 7 years old, and my mother had taken me to our family doctor for a vaccination shot. As I was nude, lying on my stomach, waiting for the shot in my butt, the doctor asked my mother: "did you take this boy's temperature, as he is going to take a vaccine?" My mother answered: "no". "Well, then we have to check his temperature now". Quite brutally, he pusshed aside my small buns , took a thermometer and slid it into my rectum. I was surprised and, as he was , to say the least, not as gentle as my mother when she used to take my temperature, I started crying. As I was crying, he kept the thermometer in place and explained to my mother how important it is to check the temperatureI of children when they are to be vaccinated. I kept crying all the time I had this themometer in my ass. After that, to the doctor's and my mother's surprise, I took the shot whitout reacting.
2. In the seventies, in the last year at my hign school, the pupils (17 to 19 years old) had a rather comprehensive medical exam ( I told this storyt in the French section of this Forum) .The school doctor we had had the previous years was a surly elderly woman and we hated when she examined our penis and testicles, but at least there was no temperature taking. This year I am now refering to, we were examined by a young female doctor. She was really attractive, with long blond hair, blue eyes and an angelic face. Furthermore, she was dressed in an allmost provocative way with a miniskirt and a blouse with several boutons left open. And during the exam, she proved to be quite friendly, treating us like human beings, smiling a lot at us. At the end of the exam, she pulled down our pants and checked on our penis and testicles. Many of my classmates claimed they got an erection at this moment. Then, with a smile on her face, she asked us to turn around and, whitout any notice, she spread firmly our buttocks and inserted a thermometer in our rectum. We had then to stand for at least three minutes with her thermometer in the butt. Personnaly, I remember she kept her hands on my buns during the whole procedure, her soft touch on my skin causing me the erection I did not have during the exam. Two other ladies were present during the whole procedure and I can tell they did not miss the show, the school nurse and the school psychologist. After the thermometer reading by the doctor, the exam was over.
Most of the boys found this temperature taking rather humiliating as we considered us as young adults, but found it exciting that it was done by an attractive female doctor. I don't know if she was the person responsible for introducing this item in the exam or if she was just obeying orders.