Wudoo’ is not invalidated by touching impure things
The things that invalidate wudoo’ 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 Baaz (may Allaah 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 wudoo’ in this situation or is it better to do so?
He replied:
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 wudoo’, but if he touches the ‘awrah, whether at the front or the back, his wudoo’ does become invalidated. But touching blood, urine or other impure substances does not invalidate wudoo’, rather he has to wash them off.
Majmoo’ Fataawa Ibn Baaz, 6/20.