If the switch, or installation of the switch, or your use of the switch, cause something to break on your Prius, it will, indeed, void the warranty. Even if it is not the cause, if it reasonably could have been, you may be called upon to prove it was not the cause before being able to obtain warranty work. This may or may not be easy for you to do, depending on the exact circumstances.
This is not unique to the Prius, it's pretty much true on all do-it-yourself work on most any make/model vehicle while under warranty.
It's not likely there would be a blanket voiding of the warranty. It would depend on the particular warranty item and whether the EV switch, or your installation of it, had caused the problem. What the switch actually does is merely ground a pin placed in the appropriate socket, thus engaging a function that is already built into the car's computer, and is standard in Prius sold in Europe and Japan.
However, yes, there is always some level of risk, as for example if you fry the computer by installing it wrong, or if your dealership is looking for an excuse to deny warranty service. Don't do anything to your car if you cannot accept the risk. For myself, I decided that the risk was low, and that if something did go wrong, I could afford to pay for repairs, and I really really wanted the switch. I'm very happy with it.