If you’re asking about resigning as an employee, it seems to work the same way: legally speaking, you could just stop showing up from one day to the next.
I imagine most of the time people will have the courtesy of giving 1-2 weeks notice if possible.
It's not just courtesy. For many local companies, the business owners will know each other and will let other business owners know if someone quits without notice, and so it's harder to get hired after that if you don't give notice.
That said, sometimes the company will decide that they'd rather you just go, and they'll tell you not to bother giving notice and you can leave immediately. Someone in another comment said that was because of bad blood, but it's also because of risk and it's unlikely that a person will be very productive during a short notice period.
When there's a tricky hand-off, though, the company might ask for and incentivize a longer notice period, too... So nothing's written in stone.
I imagine most of the time people will have the courtesy of giving 1-2 weeks notice if possible.