As Wayne wrote, stacks have to deal with such problems anyway. Refocussing will change magnification (creating a strange distortion), and when the lens to subject changes too (very probable), perspective will as well.
So the stacking software will have to deal with this.
It however is not hard to do: just find, for each point in the image, the image in the stack in which that point is 'sharpest' (by comparing contrast to neighbouring points), and put that in the combined image. Move on to the next point, etc.
Completely ignoring distortion and such issues will produce surprisingly good results.