If you had no sunburn cream, would it work to cover your exposed skin in mud and gunk as a crude way to prevent sunburn? I have never tried it. I have tried using paper tissues on my face as a sun blocker; that didn't work well.
This could be effective. Anything opaque that blocks the sun's rays from reaching your skin will be effective at preventing sunburn, whether that's a hat, the shade of a tree, or a layer of mud smeared on your skin. Some animals, like pigs or elephants, will cover themselves in dirt or mud as a means of protecting themselves from the sun. I can't say how effective it is compared to proper sunscreen, but it's certainly better than nothing.