There is no (usually in the USA) law that says when you give notice, the employer cannot fire you immediately without paying.
Of course, when that happens, you can contact the new employer and ask to start immediately. I worked with someone who was called into the office when he was about to give notice. They laid him off and gave him 6 months severance. You could always apply for unemployment for the time you are fired, though generally there is a 1 week waiting period.