Yes - in most cases. A 401(k) can generally be rolled into a traditional IRA, and a self-directed IRA that holds physical precious metals is still an IRA. The money keeps its tax-deferred status as long as the rollover is done correctly. A Roth 401(k) balance would go to a Roth IRA instead (see Roth gold IRA).
The main limit is your plan, not the IRS. Most 401(k) plans only let you roll money out after you leave the employer (retire, quit or are laid off). Some plans allow "in-service" rollovers at a certain age. Call your plan administrator and ask what is allowed before you do anything else.
Note that you cannot buy physical gold inside the 401(k) itself in most plans - the money has to move to a self-directed IRA first.



