My son in law filed for bankruptcy a few years back and the court took 1/2 of his 401K. This was probably before the new bankruptcy law passed by congress so I don’t know if the same applies today.
I doubt it. IRA's, 401k's, pension benefits, social security, etc., have been exempt from creditors both in and out of bankruptcy since I was in law school 25 years ago.