First of all, we would like to stress that there is nothing wrong, as far as Islam is concerned, to do medical research on humans as long as you stick to the Islamic manners and avoid violating the sanctity of the corpses. The Prophet (peace and blessings be upon him) is reported to have said, “Whoever washes the dead, let him do ghusl, and whoever carries him, let him do wudu.”
Muslim scholars state that ghusl after washing the deceased is praiseworthy act, but it is not obligatory. The ruling is the same regarding dissecting human bodies as this act of dissection involves touching the dead corpses.
Shaykh al-Albani (may Allaah have mercy on him) said: The apparent meaning of the above hadith indicates that it is a must, but we did not suggest that it is a must because of two mawquf ahaadeeth that are to be taken as marfu’:
1 – From Ibn `Abbaas: “When you wash your dead you do not have to do ghusl afterwards, for your dead are not najis. It is sufficient for you to wash your hands.” (Narrated by al-Haakim, 1/386; al-Bayhaqi, 3/398).
2 – Ibn `Umar (may Allaah be pleased with him) said: “We used to wash the deceased, and some of us would do ghusl afterwards and others would not.” Narrated by al-Daraqutni, 191; al-Khateeb in his Taareekh, 5/424, with a saheeh isnaad as al-Haafiz said. This was also referred to by Imaam Ahmad. Al-Khateeb narrated from him that he urged his son to write down this hadeeth.”
Based on what is mentioned above, we can conclude that if after touching a dead corpse you want to perform Ghusl, then there is nothing wrong with that as it is a recommended act according to the hadith quoted above.