Possible but Uncommon
Yes, a fox can attack a dog, especially if territorial, rabid, or if the dog approaches a den. Foxes can carry diseases dangerous to dogs.
Prevention
Keep dogs leashed, avoid fox areas, ensure vaccinations, and contact animal control if you see aggressive fox behavior.