Usually, nobody cares if you are leaving their country. Why should they care?
Because you might owe them money? I have worked in at least three countries where locally employed foreigners were required to prove their income tax payments were up-to-date before being allowed out. This involved providing the tax authorities with a bank guarantee and the whole process took about three days.