My dog also eats sand. I believe she eats the sand where the cat urinates. I have 5 dogs and she is the only one to do this. She will eat so much sand that she defecates pure sand at night. My vet calls it PICA. Look it up. Goodluck.
A dog developing cravings for odd foods typically signifies nutritional deficiencies. Consider switching brands of dog food. If the behavior doesn't change, take the dog to a vet.
A little bit from rolling in it, etc, is ok. If it ingests a lot, the sand could become lodged/impacted in the intestines, requiring surgery (this is rare).