The only thing that I have seen that looks like the white stuff (and maybe it would not, in person) is "bug" spit. Sometimes you see this white ball in the grass that looks like a lugey (loogy?) somebody harked up, but it is actually created by bugs. Here is a proper description...https://www.hunker.com/13406128/what-is-the-spit-looking-substance-on-my-grass
That stuff can get on you and look a bit like what is on your hog, but I don't know that is actually what is on your hog.
Spittlebug 'foam' is present many places a hog might hog go....but wipes away easily and I've never seen any on a pig, looks more like some type of dermatitis to me. Looking closely at the photo the color doesn't appear to be on the hair....but on the surface of the skin. Perhaps from 'scratch/injury' or bacteria, who knows.
But your suggestion brings back a memory of the first (of apparently many times) I have inadvertently insulted my Mother-in-Law. When my Daughter was about 6 years old we were picking Dew Berries. Well spittlebugs love to get into dewberry stems and leave their characteristic foam pod. My MIL told my Daughter to be watching for snakes because of all the 'Snake Spit' on the dewberry plants.
At first....I thought she was kidding (maybe passing on an old wive's tale) but it became clear to me she really meant it...as she avoided picking in the area where the foam was.
So a bit removed from her I told my daughter not to worry and showed her a spittlebug larvae in the midst of the foam. Well....MIL heard that and told me "That was what she had always been taught". I have no reason to doubt that. At a latter date she told me she didn't appreciate me 'correcting her in front of her grand daughter'. I told her that was not my intent...but that I WOULD raise MY daughter to know the truth about as many things as I can relate and that when a person learns of something they've been mistaken about...maybe they should be 'accepting' of that.
Clearly....that didn't sit well with her, as our relationship seemed to change somewhat after that. Not that I particularly care. I married the Daughter, not the family.