If you want to take the defensive way, keep in mind, that, dogs are attracted to noise.
So don't make any: Hide in some corner, don't shoot and don't move.
If you prefer to shoot them from the distance, like I do, use a gun with the silencer/suppressor attachment.
Praying they don't get to you is not always the best strategy, of course, so peek around and listen carefully to their barks, and shoot them if they get too close.
Oscar's comment made me curious about the mechanics behind an attack dog's chosen target. So I made a small test with a mate:
We stood almost side by side, I being two steps in front, in the wide area near the spawn point of the map "Launch", and let someone unleash the dogs from the other side of the tracks.
We made sure, in the ones that the dogs emerged from the middle corridor, in which they could see us at the same time, they always preferred me as the meat to bite. In this test suite, neither of us shot a single bullet.
In the second test, we kept the distance to the dogs equal, with him firing his weapon in their general direction. They always chose him.
The third set of tests brought an interesting result. Like in the first test group, I stood forward, with my mate much more distant to my right, a little behind me on the vertical.
He fired shots, I didn't.
The first dog to arrive headed in his direction, the second, as it appeared immediately behind the first one, headed for me. This was the repeatable behaviour, as we switched roles.
This showed us two things:
- They decide about their target dynamically and not as they hear a noise, but they head for the noise anyway until they see anything to bite.
- They prefer to eliminate targets that have a higher threat level (firing), then ease of access (distance).