Circling around an area allows the dog to monitor their surroundings before settling in.
Dogs may dig at their beds for some of the same reasons: to mark it as their own space and to make it more comfortable.
Digging on or around their bed is a leftover behavior from their distant, biological pasts when Dogs were wild.