Among the spectrum 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 application of these alloys in high-temperature settings faces constraints due to their comparatively lower saturation magnetization and structural stability. This study employs Fe, Ni, Cu, and Zr as representative transition metal elements to investigate the impact of doping elements on the structural stability, magnetic properties, and electronic structure of SmCo<sub>3</sub> alloy by using 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 to a certain reduction in the total magnetic moment of the SmCo<sub>3</sub>, whereas the introduction of magnetic elements can enhance the total magnetic moment. Notably, not all doped magnetic elements within the SmCo<sub>3</sub>result in an increasing total magnetic moment. The underlying microscopic mechanisms are elucidated through electronic structure analysis. Finally, it was 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 in its unit cell ranged from 0 to 22.22at%, the optimal doping concentration was predicted to be 18.52at%.