The only way it can can void the warranty is if it causes direct damage. For example, a new exhaust installed and the fueling not adjusted allows it to run lean. If this causes the engine to melt down they do not have to pay for it. But if the oil pump craps out and kills the engine, that has nothing to do with the aftermarket exhaust system, and they cannot deny the claim because of it.
The law that concerns this is the Magnuson–Moss Warranty Act. It also stipulates things like adding an aftermarket radio or windshield wipers cannot void the warranty of something like the shock absorbers. It sounds obvious, but back in the days before the law there were shady dealers, manufacturers, and mechanincs that would use any excuse at all to get out from doing warranty work. Any non-authorized changes to a product gave them an excuse to void the entire warranty. This also concerns non-vehicle products as well. Like hooking up a Sony DVD player to a Samsung TV cannnot void the warranty on either.
http://en.wikipedia.org/wiki/Magnuson–Moss_Warranty_Act