Theory of allowed resonance Raman scattering of first and second order in a magnetic field