We will have to wait for the experts to check in, but I would think that a hex file that was compiled when being told the program was for a 328p chip (via IDE board selection menu) could not or should not be assumed would run correctly on a mega8 chip. While those two chips share a lot in common, there are differences and I would not think a single compiled hex file would run successfully on both chips? Now of course if you selected one of the meg8 based board on the IDE and then compiled, that of course would be able to run on a mega8 chip.
Lefty