Work illegally is the present tense of worked illegally.
The third-person singular simple present indicative form of work illegally is works illegally.
The present participle of work illegally is working illegally.
The past participle of work illegally is worked illegally.