Animals can and do get sunburned. Sunburn is caused by ultraviolet (mainly UV-B) rays (in this case from the sun) damaging cells in exposed skin. Cell death occurs and fluid accumulates leading to blistering with subsequent peeling of the outermost layers of dead skin.
To some extent, this process is protective because it removes the possibility of severely affected cells from multiplying and passing along damaged DNA. If such cells persist in the deeper layers of the skin, they can develop into various forms of skin cancer, often years later. Some of these are very dangerous. Just as clothing and shade protect against sunburn in humans, the coats of animals such as dense hair and wool do the same. Animals with very little hair covering such as pigs and their relatives, hippopotamuses and warthogs are particularly at risk, and they often coat themselves with mud to act as a sunscreen. Rhinoceroses use the same strategy and elephants give themselves dust-baths.
Light-colored animals, newly shorn sheep and other animals that are clipped can suffer from sunburn and the parts of animals that normally lack hair cover can be sunburned. The problem can be worsened because animals may be exposed to certain substances from their feed, medications such as antibiotics, and spores of certain molds, that can photo-sensitize them, making them more likely to burn; extreme sunburn and sometimes large open skin wounds can result.
Chemical sunscreen lotions that contain PABA (paraaminobenzoic acid) work by absorbing UV-B, thereby reducing the amount that reaches the skin cells, and sunscreens are equally effective on animals that are at risk. If already sunburned, we obtain some relief with lotions containing extracts of the aloe plant and these also can ease discomfort in a sunburned animal. Prevention beats cure, so provide animals with adequate shade and they have enough good sense to avoid sunburn.