Dogs are very receptive to any sort of routine (classical or operative conditioning). If you let a dog fuck you in the same place several times, he'll start getting hard and horny as soon as he gets there even if you don't touch him. Because of this, I see no reason why fucking a dog and rubbing his penis while you do it wouldn't cause a correlation. Do it enough, and he would get hard just from getting penetrated, even if the physical stimulation doesn't do it.
But all mammals are pretty much wired up the same way. If humans enjoy anal sex, there's no reason a dog wouldn't, either, so long as you don't hurt him.