Microscopic damage and macroscopic mechanical properties of granite under the coupling effect of thermal load and initial stress are crucial considerations for the safe construction of underground geo-energy engineering. However, visualizing real-time micro-crack processes in rocks under high-temperature and high-pressure conditions using the current experimental techniques remains challenging. In this study, a numerical method is developed to analyze the thermally induced damage in heterogeneous granite under the coupled influence of initial stress and thermal loading. A biaxial thermo-mechanical grain-based model considering real mineral distribution is established based on digital image processing technology, the grain-based modeling method, and heat conduction theory. The microscopic parameters are calibrated and the effectiveness of the model is verified based on thermal shock and uniaxial compression experiments. The thermal destruction mechanism of granite under initial stress from a microscopic perspective was unveiled for the first time. During the thermal shock process, the stress within the rock does not remain constant at the initial stress value. Instead, it changes continuously with the progression of heat conduction. The impact of the initial stress on the thermally induced cracks is relatively minor. Cooling causes more damage to the rock than heating during thermal shock. The intragranular cracks of quartz consistently outnumber other intragranular or intergranular cracks during thermal shock. The initial stress and thermal shock damage enhance and weaken the biaxial peak strength of granite, respectively. The weakening effect of thermal shock on the peak strength becomes more pronounced at a higher initial stress. These research findings and proposed research techniques contribute to the management and optimization of underground geo-energy engineering.