Yelling "NO" has stopped a lot of them. They usually stop chasing after you are out of their territory.
One time on a back road we were in a line of about 12 riders, just getting up to speed. A big German Shepherd looking dog bolts from the left and runs straight into the rider in third wheel. He exits the bike in a Superman pose and lands hard on the pavement, which knocked the wind out of him. The stupid dog ran off and luckily my friend wasn't hurt too bad.