Is there any effective way to defend against attack dogs?

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.

Update:
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:

  1. 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.
  2. They prefer to eliminate targets that have a higher threat level (firing), then ease of access (distance).

You've pretty much already listed the strategies against them. I find backing up and firing at them to be the simplest and most effective way to take them out. Knifing them works fine but only if you can get the timing right and it takes a lot of practice. Just remember, at full health it takes two bites from a dog to kill you but only one swipe with your knife to take one out. So if there's only one of them, be aggressive. Like you said, finding high ground can save you from the dogs but leave you open to enemy fire. Another practice that can be useful is to always try to kill the dogs, especially when they're attacking another teammate. Their AI isn't super intelligent so if they're chasing someone else they're probably going to ignore you even if you're shooting at them. So it's a lot safer to take out dogs that are attacking other people (and it's obviously a boon to your team as well).


2 Options.

1/ The most effective place to be is up a ladder on top of some elevated platform. Dogs can't climb ladders.

Failing that,

2/ Stand in an area where you can lay a mine and also shoot down a corridor. The field of vision you have on FPS is so limited, you only see about 30-45 degree angle of vision. Therefore staying in corners helps.


Outside of what's already been mentioned, I just wanted to add to the discussion that for me with Scout Pro/Ninja combo, I was able to run right by the dogs without them attacking me. I assume it's the scout pro doing this since choppers and sentry guns don't target you too.