By law, they CAN void your warranty but generally won't unless a serious issue arises that The Motor Co. claims / proves was cause by adding/modifying with non EPA compliant parts.
In other words, if the dealer finds they won't be reimbursed by Corporate Harley then their hands are tied.
Most of us here have added different exhaust, tuner, etc anyway. Just keep your original parts in case you have to re install in the future.
A majority of HD dealers sell and install aftermarket, non EPA compliant parts as a profit center for them. If you can . . . . buy from them and let them do the install. My dealer will warranty their parts and work.
https://serviceinfo.harley-davidson.com/sip/service/procedure/54638/BLAISE/379239/en_US