The influence of size and doping effects on the magnetization M, phonon ω and band gap energy Eg of MgO nanoparticles is studied using a microscopic model. The room-temperature ferromagnetism is due to surface or/and doping effects in MgO nanoparticles (NPs). The influence of the spin–phonon interaction is discussed. M increases with decreasing NP size. M and Eg can increase or decrease by different ion doping (Co, Al, La, Fe) due to the different strain that appears. It changes the lattice parameters and the exchange interaction constants. We found that MgO NP with size of 20 nm and Fe- or Co-doping concentration x = 0.1 and x = 0.2, respectively, have a Curie temperature TC = 315 K, i.e., they are appropriate for application in magnetic hyperthermia, they satisfy the conditions for that. The energy of the phonon mode ω = 448 cm−1 increases with decreasing NP size. It increases with increasing Co and Fe, or decreases with Sr ion doping.