All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Firstly, there is a Fatwa issued by the Council of Prominent Scholars in Saudi Arabia that permits anatomizing or carrying out an autopsy for scientific purposes as the results could be beneficial in the various fields of medicine.
But this anatomy or autopsy should be done only on the corpse of non-Muslims as they do not forbid it legally or religiously. As for a Muslim, his corpse should not be anatomized for any purpose, scientific or otherwise, because the Prophet said: “Breaking the bone of a dead person is the same as breaking his bone when alive”. [Ahmad, Abu Daawood and Ibn Maajah]
Secondly: It is forbidden to transplant an organ from an impure animal like pig, into a human being, except if both following conditions are met:
1- He must be in need of the transplantation.
2- He cannot find a pure alternative.
If either condition is not met, the transplantation is not permissible.
As for anatomizing pigs and other dead animals for scientific research, it is permissible.
Allah knows best.