The Magnuson-Moss Act outlines the rights of buyers and sellers with respects to warranty claims.
Basically, if you modify your vehicle and that modification causes damage to other OEM parts, those parts won't be covered. And, of course, neither is the aftermarket part.
However, the seller cannot blanket void your warranty simply because you modified your vehicle unless the first case above is the cause and result.
Let's say you install a supercharger on your stock engine and the engine fails. No warranty for you.
On the other hand, let's say you installed an aftermarket cold air intake and your audio head unit fails. The mod you did has no affect on the failed part and that part should be covered under the warranty.
Normally, the burden of proof that an item is not covered under warranty rests with the seller. Most cases are settled in arbitration.
So what your dealer told you is what they are trained to tell you but it's not necessarily the whole story.