When BB-8 leaves after the initial attack on Jakku and before the scene ends it shows a robot peering out of the sand.
What is the significance of this and what is it?
The Force Awakens: Visual Dictionary factbook identifies this creature (note, not a robot) as a 'Nocturnal Sandborer', otherwise known as a 'Nightwatcher worm' or an 'Arconan night terror' (not to be confused with an Arconan)
It doesn't seem to be related to the previous scene, it's merely a
that happens to be in the vicinity.
The Star Wars Databank gives us a little more info
Nightwatcher worms are one of Jakku’s more mysterious life forms. These creatures, also known as sandborers and Arconan night terrors, are rarely seen – only a blinking pair of red eyes betrays their location beneath the sands. Nightwatchers top 20 meters in length when mature, and some specimens are reputed to be much larger. Scavenger lore has it that nightwatchers hunt by sensing vibrations above them, erupting from beneath the sand with their jaws wide to engulf prey.
And Rey's Survival Guide offers the following advice.
Nightwatchers - Some locals call them sandborers or Arconan night terrors - mostly stick to the Sinking Field, though supposedly they can migrate into the Goazan when big storms push sand dunes that way. They're massive worms, twenty meters long when fully grown, with some specimens five or six times that size.
I've heard nightwatchers hunt by sensing vibrations above them, erupting out of the Sinking Fields with their jaws open to engulf whatever they find. They aren't choosy, because there's nothing a nighwatcher can't devour. Their mouthparts can grind metal into scrap and their stomachs generate acid to melt down anything they can't digest.
Just one more reason to stay out of the Sinking Fields.
Along with a crude sketch, drawn by Rey herself.
This isn't a robot; from the script:
We see a FORM -- an animal, its RED EYES LIFTING from the sand, watching the rolling droid, who just keeps going.
There's nothing else to indicate its significance, if any.