Yes, you can renounce your citizenship. But this requires good reasons:
residence abroad;
guarantee of obtaining foreign citizenship.
Also, a mandatory condition is not to be held criminally liable.
Thus, according to Article 1 of the Law of Ukraine "On Military Duty and Military Service", the protection of the Motherland, independence and territorial integrity of Ukraine is a constitutional duty of citizens of Ukraine.
But foreigners and stateless persons can be accepted for military service in the Armed Forces of Ukraine under contract for the positions of private, sergeant and senior officer in accordance with the same law.