Employer-matched contributions to a 401k should be prioritized before an emergency fund. Otherwise you are leaving free money on the table. This applies to many Americans.
You borrow from the 401K. If for some reason that's not an option, you take money out with a penalty, but with sufficient match you are still often ahead.
How often do you have emergencies? Seems to me that if your life is going sideways, paying the penalty to get money out of your 401k would be worthwhile; but I expect that my life generally won't go sideways, so the extra percentage of income is more likely to be a benefit than the potential penalty is to be a detriment.