Egg hatching requires you to move no faster than a certain speed in order for distance traveled to count towards hatching eggs.
Do the same restrictions apply for moving around with your buddy pokémon?
It seems that the speed limit is very similar to the one set for hatching eggs – around 10.5 km/h.
Also, the way in which the game calculates distance and speed seems to be exactly the same for both eggs and buddies.
See more information here.