No, or almost not: the pig has very few functional sweat glands on its body, so it cannot regulate its temperature by sweating like humans or horses do. To cool off, he rolls in the mud.
An almost non-existent cooling system
In pigs, the sweat glands present on the skin are rudimentary and concentrated mainly in the snout; they secrete almost no sweat on the rest of the body. However, the evaporation of sweat is, in many mammals, the main mechanism for dissipating body heat. Deprived of this tool, the pig must find other solutions to avoid overheating, especially since its thick layer of subcutaneous fat acts as a thermal insulator which retains heat instead of letting it escape.
The behavioral solution is the mud bath: by wallowing in it, the animal covers its skin with a damp layer which, by slowly evaporating, produces a refreshing effect comparable to that of perspiration. The mud also plays a sun protection role, the pig's skin being sensitive to sunburn, and limits the bites of insects and external parasites. This behavior, documented in wild boars as in domestic pigs, is therefore a direct adaptation to the lack of effective sweating.
A very real linguistic misinterpretation
The popular expression “sweat like a pig” is misleading from a biological point of view: the animal to which it refers is precisely the one that sweats the least among farm animals. This inability exposes the pig to a real risk of heat stroke, particularly during high summer heat or in the absence of access to water or shade. Farms must therefore provide spray points, shaded areas or ponds to compensate for this thermoregulatory deficit. In the event of signs of thermal distress (rapid breathing, prostration), veterinary advice is required immediately.