I’ve twice put in my 2 weeks and have been fired on the spot. In one case, I had to ask for permission to work for a couple days for free so I wouldn’t leave my teammate hanging (the situation unfolded rather suddenly).
Knowing what I know now, I’d still put in my 2 weeks, but also be prepared with my new employer that I might start immediately, depending on how old employer takes it.