We report on the observation and systematic study of polarization sensitive magnetic quantum ratchet effects induced by alternating electric fields in the terahertz frequency range. The effects are detected in (Cd,Mn)Te-based quantum well (QW) structures with inter-digitated dual-grating-gate (DGG) lateral superlattices. A dc electric current excited by cw terahertz laser radiation shows 1/B-periodic oscillations with an amplitude much larger than the photocurrent at zero magnetic field. Variation of gate voltages applied to individual grating gates of the DGG enables us to change the degree and the sign of the lateral asymmetry in a controllable way. The data reveal that the photocurrent reflects the degree of lateral asymmetry induced by different gate potentials. We show that the magnetic ratchet photocurrent includes the Seebeck thermoratchet effect as well as the effects of linear and circular ratchets, which are sensitive to the corresponding polarization of the driving electromagnetic force. Theoretical analysis performed in the framework of semiclassical approach and taking into account Landau quantization describes the experimental results well.