The short answer is yes since it is your money. While there are no restrictions against using the funds in your account for anything you want, withdrawing funds from a 401 k before the age of 59 1/2 will incur a 10% early withdrawal penalty, as well as taxes. So, while it is possible to tap your 401(k) in lieu of a mortgage loan, it would end up being a very expensive source of funds, not to mention being very disruptive to your retirement savings.