I'm not sure that you could really call NaCl more ionic than MgCl2 since they are both purely ionic compounds composed of ionic bonds. As a group one element, sodium ionizes more easily that magnesium (a group two element). If you look at the ionization energies of the two atoms (the energy required to ionize one mole of a substance in the gaseous state), we see that the ionization energy of sodium is 496 kJ/mole while the first ionization energy of magnesium is 734 kJ/mole. So sodium ionizes more readily that magnesium. Since the anion is the same in both cases (chloride), this could mean that NaCl is more ionic that MgCl2.