Depends on the wire, how deep it is buried, and the soil. Most wire that is going to be buried underground is going to have a thick jacket and possibly shielded. Shielded wire is going to block out the signal leaking out of the wire to be traced. Normally we answer this as no.
This depends on how far behind the sheetrock the wire is, the type of wire it is, if it is in conduit or not, how thick the sheetrock is, and how new the batteries are in the testers. As the batteries in the tester weaken, the signal being sent is weaker and the transmitter has a harder time picking up the signal. If the sheetrock (drywall) is extremely thick or even doubled up, that is going to affect the receiver’s ability to pick up the signal. If they are trying to trace BX wire (wire in an armored sheathing) or if it is in conduit, it will not be able to detect the wire. These metal encasements will block out the signal being sent and the transmitter will not pick anything up.