They can only void the warranty for the part you replaced with an aftermarket part. So like, if you replaced an OEM wheel bearing with a generic one and it fails, don't expect them to pick up the bill.It's more for to keep the warranty.
A set of replacement spark plugs is $70! Though it says optional by the dealer, I don't know if it's optional to keep the warranty?
Otherwise, they can't void your warranty for working on your own car. Thankfully John Deere-type laws haven't hit the automotive universe just yet.