If you are being terminated , you can request for an NOC from them ( As suggested by MagicDragon )

But if you are leaving your own, ( resigning ), then they can always refuse to give one.