Accounts by westerners enslaved by nomadic tribes (when they shipwrecked on the coast) often talk about looking for sand to sleep on, especially when in the rocky parts of the Sahara, so I’d wager humans have been sleeping on sand for a very long time.
The kalahari bushman had a trick to stay cool on a hot day: dig a sand pit in the shade, put in the fibrous bits of inedible plant material, pee on them, lay down in the pit and cover up with sand and wait until the evening cooled things down.