Is it common to get an erection during a dermatology exam?

Yes it is possible. I had a patient of mine have that happen. Erection is a natural response, and dermatologists understand this. Just laugh it off, it can be a funny story you may tell one day.
Should not have one. Erections are not common during derm exams, but can occur if the male has the inability to control himself. Derm exams are medical and not sexual and if the groin needs to be examined, the patient should be aware of trying to control this as well as the physician maintain proper examination protocols.