Of course you can tell them that you're leaving in 6 months. Whether or not they accept that is really up to them... I'm also not sure what resigning to avoid being terminated would get you, since, depending upon the termination reason, you would be eligible for unemployment benefits but those wouldn't apply at all if you were to resign.