Once my dogsplosion gets started, I'll set up about a dozen 1x1 pastures in a big circle on the surface around my main entrance, with a war god pastured in each. Ambush squads will usually head to the nearest one and reveal themselves by attacking the dog. As soon as I get an ambush/siege notification, I go to all of the pastures and set them to be inactive. The dogs then either head into the fort, or if a goblin is nearby, the dog heads to it and slows it down a bit, giving any dwarves who are outside a bit more time to get to safety.
When things are safe, I reactivate the pastures and dwarves will bring any surviving dogs back out. Then I make the rounds and assign new war dogs to the empty pastures.
I go through a few dogs per ambush/siege, but once you've got a dozen or so dogs in full breeding mode, you start wanting to cull their numbers anyway.
I also find a half dozen dogs pastured at the entrance to the fort is a good way to get the attackers to bunch up so more enter at the same time. It sucks when you have a nice, automated drowning trap and one lone troll gets there first and is the only one to get trapped. With a group of dogs pastured outside the entrance, the lead attackers will pause a little while to deal with the dogs, and you get several attackers going into the trap at the same time once all the dogs are dealt with. Much more efficient. And as a bonus, sometimes the dogs even manage to kill one of the attackers.