That just isn’t true.
Insulation works to keep a building warm in winter and cool in summer. Is your home is insulated against the cold, it is also insulated against the heat. (Wrap up an ice cube and see what happens.)
Secondly, homes in hot countries are not necessarily built to stay cool, that is a huge and inaccurate generalisation. As an example, the average Australian home has an energy rating of 1.8 which makes it much like a tent in terms of weather proofing.
Nor are classrooms in hot countries air conditioned. Fewer than 10% of classrooms in Spain have air conditioning. Fewer than half of schools in Australia have air conditioning. 15% of schools in California have ventilation systems that meet the state’s own standards.
That aside, no one should be in a classroom with no air con on a 40C day. In fact anything above 27C is very uncomfortable. Children learn best at 22C-24C.