If it's in violation of your contract they can reject your resignation, but most people are At Will employees which means either side can terminate employment.
This is generally false. You can’t be forced to work and a specific performance judgement is unlikely. If you resign and had a contract you can’t work elsewhere, may need to pay damages. But slavery, indentures etc mostly illegal these days