The effects of the adsorption energy of CO2 within MgO at different temperatures were investigated by molecular dynamics simulations and experimentally verified. The adsorption mechanism of CO2 within MgO was discussed and explained qualitatively. The results indicated that the diffusive adsorption of CO2 by MgO was divided into two stages, and the ability of CO2 capture by the cubic MgO performed better than that by spherical MgO. The adsorption of CO2 by the cubic MgO was mainly physical and received the inhibited adsorption behavior at the high-temperature stage (>505 K). Herein, we established a comprehensive dataset of adsorption energies and quantitatively analyzed an adsorption energy prediction model using machine learning techniques. The results demonstrated that Decision Tree Regression (DTR) and K-nearest neighbor (KNN) algorithms offer satisfactory accuracy based on root mean square error (RMSE) and R2 evaluations. This approach enables efficient and precise prediction of adsorption energies without the need for labor-intensive molecular dynamics calculations. Furthermore, we explored the influence of various features (Crystal structure, The number of Mg, The number of CO2, Temperature, Pressure, Volume, and Bond energy) on prediction performance. Lastly, we globally evaluated the relative contributions of each feature across four sets of relatively effective algorithms. This comprehensive analysis enhances our understanding of the adsorption mechanism of magnesium oxide on carbon dioxide and provides valuable insights to guide the design of the next generation of high-performance magnesium oxide materials for carbon capture and storage.