Among the spectra of rare-earth permanent magnetic materials, the Sm-Co-based alloys stand out with their excellent magnetic properties in high-temperature environments. However, the practical applications of these alloys in high-temperature settings face constraints due to their comparatively lower saturation magnetization and structural stability. In this study, Fe, Ni, Cu, and Zr are used as representative transition metal elements to investigate the effects of doping elements on the structural stability, magnetic properties, and electronic structure of SmCo<sub>3</sub> alloy by first-principles calculations. The findings indicate that the doping of elements Ni, Cu, and Fe contributes positively to enhancing the structural stability of the SmCo<sub>3</sub>, while the introduction of Zr element has an adverse effect. Magnetic property calculations reveal that the incorporation of non-magnetic elements leads the total magnetic moment of the SmCo<sub>3</sub> to decrease to a certain extent, whereas the introduction of magnetic elements can enhance the total magnetic moment. Notably, not all doped magnetic elements in the SmCo<sub>3</sub> result in an increasing total magnetic moment. The underlying microscopic mechanisms are elucidated through electronic structure analysis. Finally, it is screened out that the transition element Fe is beneficial to improving the magnetic properties and structural stability of SmCo<sub>3</sub>, and the doping concentration (atomic percentage) in its unit cell ranges from 0 to 22.22%, the optimal doping concentration (atomic percentage) is predicted to be 18.52%.