In order to apply for your National Insurance Number you will need to live in the UK. The whole process must take place in the UK, you will not be able to start the National Insurance Number application process from another country.
Related articles
How long does it take to get a National Insurance Number?
What is a National Insurance number appointment?
Can I collect my National Insurance number in person?
I can’t find my National Insurance Number, how do I access it?
I have a British Passport, do I need to still apply for a National Insurance Number?
What’s the difference between a National Insurance Number and a Right to Work code?