Pooping needs a relaxed body and the sense that nothing will go wrong. Home has been tested; the toilet is the right height, the flush is familiar, the door closes, nobody walks in. A friend's bathroom, a restaurant toilet or a holiday cottage is an unknown, and for a wary child, unknown means wait.
Short waits do no harm. A child who poops at home after a day out is managing well. The trouble starts when the wait covers two or three days at a relative's house: the poop dries and grows, the eventual poop hurts, and now the child has a reason to hold next time, at home as well as away.
Children also pick up on the hosts. A grandparent who asks about poop, a friend's parent who hovers, or a busy family schedule with no quiet moment all remove the privacy a child needs. Nobody means to add pressure; it is simply a different house.
Making the preference workable is less about persuading a child to poop elsewhere and more about carrying the conditions with you: a few objects, a couple of phrases, and a routine that happens wherever you are.