If you wreck because of someone's dog running in the road, are the owners liable?

The other day I was driving down a neighborhood street, going the speed limit. There were cars on the side of the street, parked in front of homes and a dog walked out from in front of the parked car. I also heard yelling from the left of me (The owners yelling "no, stop."). I slammed on my brakes and literally came within an inch of hitting this dog head on.

Fortunately, no person or animal were hurt. Although, I easily could have ran into something when I was skidding.

My question:

If I were to hit a car or run into a mailbox because of their dog walking into the street, would the owners be liable? We have leash laws here and their dog was not on one.