Sure, but in the case of job loss + foreclosure or short sale, all of that goes up in smoke. It's a big risk.
However, closing in 30 days might be tough. 60 days is probably the norm.
But to do that you need equity. In a short sale or a foreclosure you're leaving the house without any money, which "up in smoke" seems to describe.