In reply to lucas95:
A fox is not a match for most domestic dogs. Indeed terriers were used to flush both badgers and fox's from the dens/setts. Fox's are pretty timid and don't want to risk getting into a fight (for what purpose? - it certainly cannot be food from your dog). It is not in a fox's interest to get itself injured.
As some others have said, fox's learn and a part of learning is to be curious. I've sat in my car with the door open once at night and a youngish fox came trotting along the road and looked at me sitting down, and just ambled off as though it was an every day occurrence.
The one you met may have learned that humans mean food and so its hoping if you follow one around he'll get a biscuit. My dog has taken to trying to follow our postman on his rounds because our dog has learned the postmen have dog treats in their bags and therefore is worth her while to follow....
What happens if you 'shoo' the fox away or try walking towards it?