No they don't. Pooping outside is instinct, not reason. Repeat an action enough times (going outside) and they will continue to repeat it. That and the fact that they leave their scent.
Some dogs have to be taught to poop outside.
They then reason that if they poop outside they avoid a swat with a rolled up newspaper.
No point in arguing as we both think that we are right and the world will not change if our disagreement is not resolved.
If I make it to heaven my dogs will be there. Getting there is the real issue.