From a Buddhist perspective is there any problem with this? The companies are not stealing nor are they breaking any laws - tax avoidance is perfectly legal as opposed to evasion which is not.
It's difficult to say why they avoid paying taxes. We cannot know the exact reason so this is based purely on theory.
The most obvious reason for why they are avoiding taxes would be because they want to maximize profit. If that is the case one could argue that their actions are based on the unwholesome root of Greed. In this case they are creating unwholesome kamma for themselves.
It could also be that they want to earn as much money as possible so that they can give as much money as possible to charity.
Should Buddhists avoid Amazon and Starbucks out of concerns about tax avoidance?
It depends on one's intention. If one's intention is to contribute to he upkeeping of tax avoiding companies so that they can earn more money then one should probably avoid buying at those companies since it will create unwholesome kamma for oneself.
If one's intention simply is to buy a cop of coffee then no problem.
One can also view it from the perspective of the company, i.e. from the perspective of the people who are doing the tax avoiding and thereby creating unwholesome kamma for themselves. One could minimize their ability to create unwholesome kamma for themselves by choosing to not buy from these companies. If more people choose not to support them it might end up in them choosing more carefully how they conduct their business.
There are probably many more perspectives than i mention here. These are just the ones that were most important for me to mention. Again this is purely theory since we do not know the reason behind tax avoiding. It could simply be that they need the money to open up another office building so that more people will be able to get a job.