The process is known as parallel importing. The goods that are imported that way and sold, usually at prices below the regular retail, are known as gray market goods.
Importers who use this system benefit from what is known as "the doctrine of first sale." This doctrine means that once the trademark owner has sold its goods, it has exhausted its trademark rights in those goods. The US Court of Appeals said that this doctrine preserves an area for competition, but sadly that is not the end of the story.
Many trademark owners have gained exemption from that decision and as a result certain brands cannot be imported into the USA under parallel import laws. There are ways around the red tape in some cases, but expert advice on the subject is essential. In my opinion, the massive profit potential and relative ease of selling if you can advertise big brands makes the price of that advice well worth while.
This is a big subject, and I have posted a detailed blog on my site dealing with the situation specifically relating to the US, although I plan to make more posts relating to other countries later.
It is essential to understand that parallel importing refers only to genuine goods manufactured by the trademark owner or a licensee. Knockoffs, imitations, very similar products and any kind of copy will be confiscated by the CBP agency.
Finally I must add: I am not giving legal advice of any kind.