When I or colleagues have changed jobs then we have given a month or more notice, continued working etc. Only when someone is fired for total incompetence or just not showing up you don't want to see them anymore ever in the office so the company pays for the notice period time.
Likewise, if the company lays you off, they have to give you up to 8-weeks notice depending on how many years you were with the company; 10+ years warrants the full 8-weeks, while 2-4 years in service gets you 2-weeks. These are also mandatory minimums; some companies or employees with contracts or collective agreements may get / offer more.
Plenty of loopholes there, like for "just cause", and some industries are "exempted by custom" or by law, like construction or forestry.