Observations reveal a universal stellar mass–stellar metallicity relation ( MZR ) existing in Local Group dwarfs of different types , Z _ { * } \propto M _ { * } ^ { \alpha } with \alpha = 0.30 \pm 0.02 . In this work , we investigate the “ universality ” of the MZRs for both satellites and central galaxies in a large number of different host dark matter halos covering a large mass range of 10 ^ { 9 } – 10 ^ { 15 } h ^ { -1 } { M _ { \odot } } , by using a semianalytical galaxy formation and evolution model . We obtain the following results . ( 1 ) The exponents ( \alpha ) for the MZRs of the satellites in halos with the same mass as the Milky Way halo but different individual assembly histories are mostly \sim 0.2–0.4 , i.e. , having a scatter of \sim 0.2 ; and the scatter of \alpha increases with decreasing halo masses . ( 2 ) The MZR relations are changed little by the variation of halo masses and the classification between central galaxies and satellites , if many halos with the same mass are stacked together . ( 3 ) A double power law exists in the MZR relations for both central galaxies and stacked satellites , with \alpha \sim 0.2–0.4 at 10 ^ { 3 } { M _ { \odot } } \lesssim M _ { * } \lesssim 10 ^ { 8 } { M _ { \odot } } and a relatively higher \alpha \sim 0.5 at 10 ^ { 8 } { M _ { \odot } } \lesssim M _ { * } \lesssim 10 ^ { 11 } { M _ { \odot } } . ( 4 ) The high-mass satellites ( M _ { * } \gtrsim 10 ^ { 8 } { M _ { \odot } } ) existing mostly in high-mass halos can lead to an apparent increase of \alpha ( from \sim 0.2 to \sim 0.4 ) with increasing host halo masses shown in the single power law fitting results of stacked satellites . The universality of the MZR suggests the common physical processes in stellar formation and chemical evolution of galaxies can be unified over a large range of galaxy masses and halo masses .