These two techniques are actually pretty similar. Both involve placing a sample in a magnetic field and using radio frequency waves to bring them into resonance. This happens because the spins line up either parralel or antiparallel to the applied magnetic field, creating two energy levels. The radio frequencies are used to cause transitions between these energy levels, disrupting the equilibrium of the system. When equilibrium is reestablished, resonance occurs.
The major difference is that in MRI (or NMR) you are looking ant nuclear spin. For MRIs, I believe you are looking at the spin of hydrogen nuclei in water molecules in your body (mostly), which helps to create the imaging. As its name suggests, electron spin resonance looks at electron spin. Electron spin resonance only works on species that are paramagnetic (having unpaired electrons in their structures)