There's a short answer to this one: No!

It's almost never a good idea to quit because you feel you're being mistreated or are about to be fired. Quit, and you have just given away a good portion of your legal rights and the ability to obtain justice. 

In particular, do not fall for the old ruse that “we'll allow you to resign by X date, so your record won't show that you were fired.” Your employer is toying with you. You will gain nothing financially, nor in terms of your HR record or reputation, by doing this. If your employer wants you to leave, make them fire you. 

However, as soon as they offer you this “choice,” contact a lawyer to ensure that your rights are protected.