Yes. Often. In fact a little OCD is an excellent quality in certain types of meducine. Esp in surgeons as it guarantees a 100% focus on details and routines. A good quality in the chaos if an ER as well. It would help in getting thru med school, studying, keeping up with schedules, etcpassing the boards, as well. Of course, as with any such issue, if it reaches a point that it causes more problems than it helps, when it is out of control, then it can be a danger rather than a help. Doctors have to at least a little flexible so their OCD has to be self-controlable however. My bro in law is an ER doctor and has mild OCD. He does very well.
There are some OCD patients that have successfully studied medicine. However, when being recommended for such a career, your therapist must always look at the severity of your condition. You can confirm from your therapist the extent of your obsessive compulsion disorder.