best not to encourage dogs running beside us.
The places where I like to ride are places where I will see 1 or 2 cars an hour, and if I do see a car there is a lot of room to go around us. Of course this is the commuting forum, and on my commute if a dog were to decide to chase me it would probably end up getting hit by a car. In this case I would not want to see the dog get hit so I would do what I could to avoid any sort of accident. But during a ride out in the country where cars are almost non-existent, in my area anyways, I do not mind a dog running with me. Sometimes when it is hot and a dog has ran beside me for a while I will stop and offer it some water.
One case I remember is when on tour and in the middle of no where. I had a medium size dog run beside me for what seemed to be about 10 minutes. I tired myself out trying to outrun it. When I stopped and rested in the shade I shared some food and drink with the dog as it relaxed with me. When I got back on the bike after resting the dog turned around and headed back home.
All the dog wanted was a bit of company, and since I was alone I did not mind having the company. The best part was the dog did not complain about anything and was happy to go at any speed I wanted, and was willing to rest when I wanted to rest. I have toured with people who were a lot less friendly and complained about everything.
It is always nice to make friends on the road no matter what species they are.