Nissan tried to deny me warranty coverage on a bad turbo on my Z because they said my aftermarket air K&N filter caused it. The first step was the BBB's Burau of Automotive Repair. In this case, the threat to arbitrate through California's State Certified Arbitration Program was enough.
Nissan decided to cover the repair under warranty.
In a nutshell, these are the resources and agencies in addition to the BBB at your disposal:
http://www.dca.ca.gov/acp/pdf_files/englemn.pdf
Although not specifically related to a modification in 2001, I had a C5 Corvette repurchased as a lemon because GM refused to fix an oil burning problem. It was a relatively painless process that not only cost me nothing but netted me:
1) Re-purchase of vehicle at original purchase price + taxes.
2) Two years of registration and VLFs.
3) Attorney's fees paid for.
4) $5000 in punitive damages.
Ironically, they came up with a fix that they tested on my Corvette but only after the repurchase had been finalized but before the car was turned back in. After the repurchase settlement was signed, they had me keep the car for another 6 weeks while they arranged to take possession of it back. After they oil burning fix(replaced oil scraper rings on pistons) and me confirming that it fixed the problem, they asked me if I wouldn't mind undoing the buyback and keeping the C5. I of course declined as the settlement got me everything I ever paid for it plus more.
The 2001 C5 oil consumption issue was a well known issue that not only you, but several other owners were able to have rectified as it was a defect that GM admitted to.
But as to the Lemon laws, they vary by state.
In some states, if the car is within a year old 12,000 miles and has 4 repair attempts for the same problem and spends 30 calendar days out of service, you may have relief under the Lemon Law and may seek a buyback.
The mileage and number of repair attempts may vary from one state to another.
But having a car Lemon lawed is considerably different than tampering with it's software and then trying to have a warranty repair covered.
So I don't see your comparison here.
As far as your air filter in the Nissan was concerned, Mag Moss is in place in part to allow you to use replacement parts, such as air filters, oil filters, etc., that may not be genuine manufacturer's parts or manufacturer's endorsed or recommended parts as long as the part meets standard and accepted speciations.
For example, one doesn't have to use AC Delco parts in a GM vehicle and fear having their warranty negatively impacted by not doing so, as long as the replacement part meets accepted specifications.
If you put a Purolator or Fram or K&N oil filter on it next time you change your oil, that's not considered an aftermarket modification.
One does not have to use Mopar parts in a Dodge. Put Motorcraft or AC spark plugs into it, you can't have your warranty affected under Mag Miss because you didn't use original spark plugs.
Nor do you have to use Motorcraft parts in a Ford if you're replacing filters and such.
Your K&N Filter, as long as it filtered within accepted specs, and had CARB approval, and did not alter your air box and your wasn't altered or repositioned, and you were within CARB regulations, you never had anything to worry about in the first place.
Just as if you had brought it in with an AC air filter or Fram air filter on it.
And Nissan knew it. They seem to have been pushing to see if you would push back.
A manufacturer can't deny warranty coverage just because you didn't use the same brand air filter or oil filter, brake pads, or plugs, or any other disposable item the car was delivered with, as long as the part you're replacing with meets accepted specs.
So your examples are a bit of a stretch.
What we're talking about here, is quite different. Some would of consider it hacking.
And the minute that word came up, one would very possibly be in a warranty fight.