When I'm walking my dog next I think that I might throw away his poop in the neighbor's garbage.
Why would you throw away dog poop in your neighbor's trash? Wouldn't you feel guilty?
I wouldn't do it if my neighbor didn't see me carrying the poop bag.
You shouldn't throw away feces in your neighbors trash. They're entitled to their own private property and you using their trash cans without permission is a violation of their property. They may be upset if they catch you doing this.
It's all good, they will never see me doing it.
It's not about being caught, but rather respecting your neighbor enough not to put your dog's feces into his trash can. You could just carry it with you and dispose of it in a public trash can, or at your own home.