This is a little bit hypothetical question… Let's assume I finished my PhD in math in my country but I am dissatisfied with it (assume I live in a developing country). Also I have enough money and time. Can I apply for a similar PhD program in an another country? Is it theoretically possible?
No, it's generally not possible. Almost all Ph.D. programs have a rule against admitting someone who already has a research doctorate. Under special circumstances, one might be admitted as an unfunded Ph.D. student in a completely different field; but in the same field, never.
If you want to obtain a PhD from a 1st world country I think your best bet is to go to another country as soon as possible. It will be a lot easier to get into a PhD program with a masters degree from a similar country, and it will be easier to continue your career abroad if you have followed a funded PhD program (as opposed to paying yourself / getting a grant from your home country).