I am no expert and last time I had to involve myself with this was 25 years ago. But reading up on recent changes and in response to some requests, I am doing my best to summarise a complex issue. It is not a comprehensive guide nor a legally-qualified one, just an outline of the principles and possible dangers where online facilities are concerned.
VAT (or "Value Added Tax") is probably one of the fairest forms of taxes ever conceived were it not for the fact that its logistics have been endlessly tweaked by beaurocrats for self-serving purposes and an effective job-creation scheme for accountants. The principle behind it is clear...
Anything of value, be it a product, goods or services, has a percentage of it's price charged by the government as a kind of "sales tax" paid by the end consumer. Items considered to be "luxury goods" have the tax levied at full rate, with semi-essential goods at a lower rate. Wholly esstential goods and services are either "zero" rated or included in a list of exemptions. "Essential" goods and services are by and large now defined by the valies of 50 years ago rather than the present. An example might be the tax on communications. At heart, the tax "should" apply to items people "want" and not the items they "need".
The mechanics of the tax are also easy to understand. If the supply chain can be viewed as a "ladder", each rung of that ladder has the tax applied to it, but the tax can be reclaimed at every level except the final sale. The final sale is where it reaches the consumer. Small enterprises that do no reach the "turnover threshold" to register for VAT counts as consumers, but of course they are spared the admin costs of charging it too.
Once a company is registered for VAT they are assigned a number whiuch can be traced up and down the supply chain to prevent fraud or mis-charging The tax is added to invoices and bills at the time they are issued, but accounting is normally after-the-fact by around 13 weeks or more. Taxes are then handed over to the government, whilst any taxes paid during creation or manufacture are simultaneously deducted from the total "sales" tax due to be handed over.
In the EU (European Union), VAT is imposed by law throughout member states and a minimum tax of 15% (at full rate) is also imposed by the same legislation. Some states operate VAT at a considerably higher rate, but none at a lesser rate. Where cross-state (international) transactions are invloved, the final VAT is imposed at whatever rate applies in the country where the final sale is made. As a consumer tax, VAT is not levied on exports - it will be imposed at the destination country within the EU or not at all in countries where VAT is not used at the final point of sale.
Goods and services "imported" into a VAT-charging country have VAT applied the moment they arrive in that country - whether for direct sale or as components in the supply chain. No VAT is payable or chargable to or by foreign territories who are part part of the VAT-charging community of countries as a rule, since taxation of this sort is a matter for the country of origin.
Recent changes for electronic commerce have somewhat confused the system further. Telecommunications and similar networking systems are liable for VAT, despite being "essential" tools of living in the modern world. VAT is charged via the web or other electronic space in much the same manner is if the purchse where in a physical shop or from a physical office. The person selling something electronically will be registered for VAT with their government and will pay the tax to that government. Within the EU, the tax will be levied at the rate charged by the government where the final sale takes place.
There are now instances where non-EU countries or VAT-charging countries may be seen to be imposed VAT on sales where in the physical world this would not be possible. A business in California for example, has to charge the USA equivilent of VAT, "sales tax" to customers within its own state, whereas they do not charge "sales tax" on export to other states or outside the USA itself. (Even though other tariifs and export duties may apply). When the product or services from California arrives in the UK or another EU country, VAT applies and is imposed by the reseller or agent as physically enters the country. But if there is no reseller, traditionally no VAT can be charged. If you buy a Californian product in a shop, you pay VAT to the government, but if the same product is sent to you direct in the mail, there is no reseller involved to charge VAT and thus you will not be paying VAT. (You might be paying other import duties, but not VAT). Since electronic sales have more in common with the latter example, new provisions have been made of countries to collect VAT on consumer purchases originating outside the EU, but equally there must be provision for the charged VAT to be paid to the government when the final sale is made.
Using the previous example, if someone in California charges you VAT for something purchased electronically, you need to make sure the tax is verified. For this purpose, the seller must provide you with a VAT registration number and the rate of VAT must be that charged by the VAT-charging country you are in. In any other instance, charging of VAT will be a fraud and be the stealing of funds rightly due to your own government. If in doubt, demand the VAT registration number and then verify that registration number with the customs and excise authority in the country you are in. They will be able to take further action if there is anything suspicious.