There are some amazing genuine homeless people out there that are really trying to get a break in life. When you see someone with a dog it doesn't necessarily mean that they are doing it to pull at heart strings, get more money etc etc, Remember that for some they may have not been homeless when they had the dog and as we all say a dog is for life not just for Christmas, therefore they may not be able to let go. I know most homeless people i know look after their dogs more than they actually look after themselves.
That being said i would always say not to offer money, always offer to buy a hot drink, food, something for the dog anything that doesn't involve you handing money over. Any genuine homeless person will be grateful of a hot meal etc.
Sadly most homeless people do have a addiction of some sort whether that be alcohol, drugs or both therefore offering to buy them a hot meal or something for the dog etc, doesn't fund their habit and they will be grateful of a full belly.