In a way, they do. Dogs and other animals have a circadian rhythm, which in a way is like a body clock or a natural rhythm. Instead of looking at the clock or watch like we do, dogs keep track of time from this rhythm.
Dogs will then time certain activities within their rhythms, even associating mealtimes with it. In a way, they are following a set of routines hence, the idea that dogs seem to know when their owner is coming home.
To complement their strong sense of smell, dogs may use the strength of scents to mark the time of the day. An example would be telling the time by the smell of the food that was prepared for them before their owner leaves for work