Praise be to Allah.
The things that invalidate wudu are well known, and are mentioned in the answer to question no. 14321 . Touching something impure is not one of them. But if a person touches something impure, it is not permissible for him to pray until he has washed it off.
Shaykh Ibn Baz (may Allah have mercy on him) was asked:
What is your opinion concerning a doctor whose work sometimes involves looking at the `awrah of the patient and touching it for the purpose of medical examination? Sometimes when doing surgery the doctor has to work in an environment that is filled with blood and urine. Is it obligatory to renew wudu in this situation or is it better to do so?
“There is no sin in the (male) doctor touching a man’s `awrah in cases of necessity or touching it for the purpose of treatment , whether that is the `awrah at the front or the back. He may look at it or touch it in cases of necessity. Also it does not matter if he touches blood if he needs to during surgery, whether to remove it or to check on the state of the wound. But he should wash his hands afterwards to remove whatever has gotten onto them. Touching blood or urine does not invalidate wudu, but if he touches the awrah, whether at the front or the back, his wudu does become invalidated. But touching blood , urine or other impure substances does not invalidate wudu, rather he has to wash them off.” (Majmu’ Fatawa Ibn Baz, 6/20)
And Allah knows best.