It is thought that dogs have the ability to make a mental map of an area, they can survey the area by taking note of terrain, and using their sense of smell as well as hearing to build a mental map.

A Jack Russell bounding across the grass
Some scientist think that dogs can sense the magnetic field and somehow use this to navigate.