The stress caused by such sudden change in temperature is called Thermal Shock.
The intensity of the thermal shock is dependent on the temperature coefficient of expansion of the material. Materials with lower temperature coefficient of expansion can withstand temperature differences better than those with higher temperature coefficients.
Borosilicate glass is an example of a material which can withstand sudden temperature differences.
Thermal shock resistance is the property of a material to resist thermal shock. Thermal Shock Testing involves subjecting the test material alternatively to high and low temperatures.