I don't know about magnetic alignment, but as a dog owner, there is clearly _some_ kind of search algorithm running in that little brain. My dog will weave a path all over the yard before finding an ideal spot.
My dog poops as though he requires 5 legs, an extra one to hold a gun at all angles to make sure nobody attacks him while he does his business.
Concur, my dogs stance always struck me as a "I'm vulnerable as h*ck while doing my biz".
That's why your dog watches you while pooping. They're vulnerable, you're able-bodied and will spot danger first, so they take danger cues off you.
My pup won’t poop in the yard at all (and gratefully has an aversion to poop generally). So we walk for poop business, and she often needs to get a running start. Often also this running begins downhill, and then up, rounding the edges of whatever prospective poop designation until finding just the right spot. And then she does a cartoon-style “wind up” where her legs are running but her body remains stationary. It’s all very adorable except when the terrain is slick or when she decides the right spot is down a very steep side hill.