1. While it is technically true a company could sue a worker for quitting, the amount of damages they'd have to show is far beyond anything they'd be able to do outside of an upper management position. As far as I know, you could not sue someone for doing a half assed job.
2. I'm not even sure how you are using the word "illegal" here. AFAIK there is no provisions in criminal law for punishing people who break employment contracts. What I assume you are talking about is that a contract worker is bound by the terms of their contract as far as notice to quit goes, but there are a couple of limits to this. - This only applies in the first year of the contract. After the contract has been renewed once, standard Japanese labor law applies, which is two weeks of notice. - Similar to the above statement about suing someone for quitting, Japanese law only allows for suits to be for actual damages, so the company would have to prove significant damages to make the suit worth it. Contract workers are generally not high value employees so it would be unusual for one to be worth suing over.