You can do, whatever you want, but as long as a pirate acts within his parameters, you have to deal with the consequences. If you don't want to get taxed/robbed, hire escorts or take a ship that you can defend yourself, or avoid trade lanes, since it's easier to avoid pirates while you cruise. Trade lanes mostly spit you out right at the pirates nose.