I am a university lecturer in the autopsy department. Is it permissible for me to dissect the corpses of the deceased with prior permission from them before death, or with the permission of their next of kin, given that dissection is for teaching purposes?

It is not permissible, and this should instead be done with animals that have resemblance in their body parts to humans. If there is compulsion to do so, then it should be done with the corpses of the non- Muslim, with their prior permission. As for the Muslim dead, it is not permissible.