You can bring a claim against a third party who installed a fence or enclosure if its substandard or shoddy installation allowed the dog to escape and cause injury.
You can bring legal action against a third party who harasses a dog, subsequently causing it to attack you.