The surrounding rock of underground rock chamber is frequently affected by disturbance load and circulating temperature; it is meaningful to study the mechanical properties of surrounding rock under these conditions for the construction of a safe and effective underground chamber. This study investigates the mechanical properties, failure modes, and acoustic emission (AE) characteristics of basalt and sandstone under various pretreatments, including water saturation pretreatment (rock samples [SR]), rock samples subjected to cyclic temperature pretreatment (SR-CTT), rock samples subjected to cyclic loading pretreatment (SR-CLT), and rock samples subjected to combined cyclic loading and temperature pretreatment (SR-CTT-CLT). A series of uniaxial compression tests (UCTs) were conducted to analyze how these pretreatments affect the mechanical properties of basalt and sandstone. These two kinds of rock exhibit distinct failure modes, SR-CLT and SR-CTT-CLT make the failure of basalt change from inclined shear to X-shaped shear, while SR-CLT makes it turn into splitting. AE data reveal that basalt generally exhibits lower AE counts than sandstone, with the highest counts observed under SR-CTT-CLT. Energy analysis indicates that basalt accumulates more total energy (Et) and elastic energy (Ee) compared to sandstone, with different pretreatments affecting energy dissipation (Ed) and damage severity differently in each rock type. These findings contribute to understanding the complex interactions between pretreatment methods and rock behavior in engineering applications.