Sure, but if you're trying to have another job lined up, it's a lot harder to find one before you quit. "We need someone right away, can you start in two weeks?" "Sure, I'll put in my notice tomorrow." is going to be a lot more common than "We're completely sure we need someone new starting 6 months from now, go ahead and quit your job."