The phenomenon of surrounding rock damage and rupture caused by high temperatures is widespread, and has become a potential threat to the safety of nuclear waste disposal repositories. In order to reveal the energy distribution pattern of fractured granite during the failure process under different confining pressures, triaxial compression tests were carried out on rocks with different initial thermal damage. Firstly, the rock was treated at a high temperature to analyze the change rule of the porosity of the rock after high-temperature treatment, define the equivalent damage coefficient, and analyze the influence of confining pressure and equivalent damage coefficient on the peak stress and peak strain of the rock. The results show that, after high-temperature treatment, the porosity increases with the increase in temperature. The peak stress and corresponding strain of rock samples with similar equivalent damage factors increase with the increase in confining pressure. By comparing the rock samples with the same confining pressure and different initial thermal damage, the larger the confining pressure, the smaller the difference of peak stress of different initial thermal damage specimens. Then, the energy density of rock in a triaxial compression test is quantitatively analyzed by energy theory. The results show that, as long as the confining pressure is the same, the proportion of the dissipated energy of the specimen has a similar evolution trend with the strain. When the confining pressure is the same, the proportion of dissipated energy decreases rapidly with the change of strain due to the increase in equivalent damage factor, but the rate of decline will gradually slow down; however, when the confining pressure increases, the difference caused by the equivalent damage factor will gradually decrease, because the fracture is bound by the confining pressure. Finally, we analyze the maximum dissipated energy during rock deformation and failure. According to the inflection point of maximum dissipated energy, the optimum time for critical support of the key rock mass is determined.