You have federal laws and varying state laws on this.
Generally the first mortgage will just issue a 1099 for forgiven debt which as your principal residence will be wiped out with the federal law if it happens within a certain time period.
Second loans,heloc's,etc. many times rather than accept a short sale will sell off the debt to a asset collection company for a discount and THEY WILL after foreclosure pursue you by collection,then judgement,then they will obtain wage garnishment or bank levy. the only way to stop them at that point is go to a cash job and not have a bank account or file for chapter 7 bankruptcy to wipe them out.
If you own an investment property that gets foreclosed on then it depends on if you have other assets titled in the same company or your own personal name they can go after.
So just like taxes it is on a case by case basis with no blanket answer. The owner should seek legal counsel to answer questions specific to their situation.
no legal advice