I had the same thing happen when I was out with my two.

Only I was attacked by a Yorkie. A firm "no" a few times did the trick for me.