This does not constitute professional tax advice. We strongly advise consulting a tax specialist to find out your specific obligations.
If you're located in the European Union, you should register in the country that you conduct business.
If you're not located in the European Union but plan to sell there, you can choose in which EU country to register, and consult a tax specialist.
You can apply for a VAT ID at each country's State Revenue Service or tax institution that's in charge of VAT registration. For example, UK customers can find info here. In the UK, It usually takes about 1 month to approve VAT ID applications.