For about six weeks between late August and early October, one specific tree on your street becomes a problem.
Magpies swoop while there are chicks in the nest, and they stop when the chicks fledge. It is defensive, it is temporary, and it is directed at whoever the bird has decided is a threat — which, unhelpfully, is often the same person every day.
What is actually happening
A swooping magpie is not aggressive in general. It is a parent with a nest within about a hundred metres, and only a minority of birds swoop at all. They also have excellent facial recognition and long memories, so a bird that swoops you specifically may ignore your neighbour entirely.
They are also a protected native species in every state. Interfering with a magpie or its nest is an offence, and beyond the legality, the bird is doing an entirely reasonable thing.
Why dogs make it worse
Two reasons:
Dogs look like predators. From above, a dog moving under a nest is a threat in a way a person is not.
Dogs escalate. A dog who barks, lunges or jumps at a swooping bird confirms the threat assessment, and the bird commits harder. Some dogs will keep trying to catch it, which is how a dog ends up with an eye injury or a bird ends up dead — and the second one is both illegal and awful.
The plan that works
Change the route. This is the whole answer and everything else is a footnote. One tree, six weeks, a different street. Magpie territory is small — crossing to the far footpath is often enough.
Keep the lead short and keep moving. Swooping is territorial defence, not pursuit. Walk through calmly and it ends within twenty metres. Stopping, waving your arms, or letting the dog spin and bark all extend it.
Do not run. Running triggers more swooping, and a dog whose person suddenly bolts learns that this street is genuinely frightening.
Walk, do not cycle. Bikes get swooped more than pedestrians, and a dog running beside a bike under a nest tree is the worst combination available.
Carry something over your head if you must pass. An umbrella or a hat. Eyes are what they aim near, on both of you.
If your dog gets hit
Magpies rarely make contact with dogs, but check for eye injury if they do, and see a vet for anything near the eye rather than watching it. A scratched cornea gets worse quickly.
Teaching a calmer response
If your route genuinely cannot change, the useful skill is keep walking beside me while something is happening, which is the same skill as everything else outside — pay attention on you, at a distance where the dog can still think, and shorten the exposure.
You are not training the dog to accept being swooped. You are training them not to add to it.
The good news
It genuinely ends. The chicks fledge, the bird goes back to being the one that sings on your fence at dawn, and next year it will probably be the same tree — which means you will know in advance.