Assuming that pushing, towing, and jacking are all out of the question—how safe is it to dig a trench under a car that's stuck on a lawn to gain access to change out a part? Are there risks of sliding wheels due to weight being dispersed differently? I would imagine that chocking the wheels would minimize this risk.
It would not be reasonable to dig a trench under a vehicle to fit a part to a vehicle. The trench would need to be shored up so that it does not collapse inwards, especially if you are in the trench at the time. The cost of timbers and the time and effort involved to make things safe would be prohibitive. The way forward is contact your local recovery firm, explain your problem to them, and listen to their 'on the scene' advice. They will proberly drag the vehicle to good ground with a winch.
You must take into consideration, the looseness of the dirt that you're digging into, the moister in the dirt that you're digging into, weight of the truck, the width of the truck, the weather over the course of the time the whole is going to be used under the truck, the stupidity level inside the person that will be laying in this pit, and the size of the part that you would be replacing in the vehicle.
All in all, terrible idea.
If you can't tow it or push it or find a way to get it out the truck must have gotten eaten by a sinkwhole or driven off the side of a boat. Either way, if you got the truck to wherever it is, you should be able to get it out.
I assume you mean just making space under the car, right? That's how most oil lubes do it. While it is dangerous be sure to chock the wheels and yank the parking brake up and you should be fine. Best of luck, remember, safety first!