This isn't really about minor details like laws, it's about defection.
In politics, a defector is a person who gives up allegiance to one state in exchange for allegiance to another, in a way which is considered illegitimate by the first state. More broadly, it involves abandoning a person, cause or doctrine to which one is bound by some tie, as of allegiance or duty.
Your man is going over to the other side. It's illegal in the jurisdiction he's coming from, but not the one he's going to. As long as he never goes back, nothing outside the whim of his new mad dictator is legally going to hurt him.
The key though is never going back. He's effectively committed treason against the country he's come from. His chances of ever seeing daylight outside a small square surrounded by concrete walls are pretty slim if he ever tries to go home. There's also a reasonable chance he'll spend the rest of his life needing constant protection from assassins.
He really has to be believe he has nothing to lose and everything to gain. It's a one way trip.
Why laws don't apply
Laws and law enforcement bodies have a jurisdiction. This normally ends at a national border. If that border takes you to another country then the next country's laws apply. If you go to sea then the International Law of the Sea applies, along with the national laws of the country where the ship you're on is registered.
What this means is that leaving your home country is legal, going to the new country is legal, working for the mad dictator in this way is legal in your new country, illegal in your home country but outside their jurisdiction. In most cases, like smoking weed in Amsterdam, that's not a problem. In cases that could be considered treason, like giving military secrets to a hostile state, you're going to end up in a lot of trouble, but only if you go home (or to a country with an extradition treaty with your home country).