TBH unless you have food in the garden I doubt a Fox would bother if there are woods and fields around.
We’ve lived here, surrounded by fields and woodland for many years and the only time a fox came into the garden was when the hounds chased it, many years ago.
Urban foxes will come into your garden and live under sheds, decking etc. But rarely in the Country.
As to keeping them out? If they want to come in they will get in, as someone has said they can run up fences and walls and they usually scream and cry so no doubt about it being a fox, plus they leave scent markings which smell awful and your dog would be going crazy all day.