Depends a bit on the dog too.
Dog 1 likes to be in a similar position, so she is placed on the wheel of the lead rider, Dog 2 likes to take up the rear so she gets that position.
The training tips above still count, but it is easier to train them in to their natural place, rather than trying to enforce a position. Luckily Dog 1 is a flyer so she keeps tight on the wheel when we are going at speed.
Both ours still need work on the road – will follow sandwicheaters advice. And yes, they do learn when they get clipped by a wheel, but it is hard to let yourself do it (better done under some control than waiting for it to happen at full speed).