I did once see that a lynx had become injured when it had killed a pig at my settlement. It might have been the dog that was tied to the same tree or perhaps the pig that it killed. The wild boars draw aggro, so perhaps the tame ones attack hostiles too?.
In general I find the animals way too aggressive against player's domestic ones, both in and out of settlement. It's the moment when the game's "I just want to live" animal AI switches over to the movie monster one. The player character, dogs and companions should be effective by their mere presence at dissuading predator attacks, particularly when around in numbers. I don't mind if I see occasional starving pack of wolves especially in the winter, but it's shouldn't be every encounter.