Only if whatever breaks is because of it.
If it snaps in half, and your engine smashes through the firewall, then warranty won't cover it. If your stereo stops working, then no.
To deny warranty, the aftermarket part must be directly responsible for whatever repair is required. In the U.S. search for the Magnuson Moss Act, in Canada, well you're screwed.