I don't know if it's needed for Spain.
I found this about Brazil:
Brazil VAT (VAT-Value Added Tax) number is divided into the following two types: A, CNPJ (Company -XX.XXX.XXXXX/XXXX-XX) B, CPF (private - XXX.XXX / XX.XXX). From the beginning of March 2006, the Brazilian customs on imported 100% of the parcel identification, if not in the above-mentioned provisions and INVOICE AWB indicate VAT (VAT-Value Added Tax) number, the Brazilian customs shipments will be automatically returned to sender and costs associated with returning from payment of copies.
Obviously that's a poor translation but it seems like parcels sent to Brazil need a tax number or they get returned.