Quasi-exact solvability of Dirac–Pauli equation and generalized Dirac oscillators