We are guide dog puppy walkers
The puppy is trained to wee on BUSY command and poo on BUSY BUSY or BIG BUSY command
This they learn from 8 weeks and usually get to be under control with it from 14 weeks ish (iirc) we haven't done it for a while due to my DH ill health
Anyway the point being, that the puppy learns to do it on command at home in a specific area in garden, that is fenced off, before leaving the house and to hold on until returning home
They learn this by us getting so excited each time that they wee or poo on command
As in you take them outside to the spending area and as they squat to wee or poo and in the process, you say the words then straight afterwards you get soooooo excited that they realise that they have done something terrific in your eyes that they want to do it again the next time
This is done many times a day then they get to learn what to do when the command is given to then get huge amounts of cuddles and praise and an excited puppy walker
Obviously if they are out and about for a long time then the puppy will be trained to go after the command is given followed by lots of excitement and praise
The more time and energy that is put in at the beginning by the puppy walker the quicker it happens and also you have clean and dry puppies in the house with less accidents
Puppies give signals to show they want to go or you will know by their routine and so they wait until they are in suitable safe place
Our 5 year old ex guide dog puppy (who came back to us as a pet) knows that she gets to go to the park or beach or woods or wherever after she has done her busy and big busy in spending pen and so she never poos on a walk as she has done it at home beforehand
If we were out for a long time she still wouldn't just go she would signal that she wanted to and we would find a suitable safe place then give the big busy command that she would then poo
Think of pavlov and his dogs
So if a guide dog owner knew the routine of their dog they would want it to go at home before going out but if that wasn't possible the dog wouldn't just go on the footpath it would wait for the command so the guide dog owner was in control and be expecting it with the poo bag ready iyswim