Answer:
It depends on the country, some countries might allow you to vote even if you are not a citizen of that specific country but, in others, you will have to wait until being a legal citizen to vote.
You can search which countries allow you to vote and which ones don't. However, I can provide you with some of them:
don't: the U.S.A
do: "They include a broad range of nations, from Denmark to Chile to
New Zealand"
I found this answer on the website called ThinkProgress about the article "Why You Have Nothing To Fear From Non-Citizen Voting"
Explanation:
So, short answer; depends on the country the alien goes to, if it is a country where he must be a citizen to vote, then he has to check the requirements needed to be a citizen in such a place. Otherwise, technically it wouldn't be a problem.
I hope this helps!