Imho, it would depend on what you are trying to claim as a repair under the warranty. If you had the hitch and came in for a clutch repair, I think you'd have a hard time. But if the radio quit or something totally unrelated, I think you'd be fine.

Exactly! They can't "void" your entire warranty anyway; legally each failure stands on it's own. If your trailer hitch could be proved to have caused your cheap radio to fail, I guess they could refuse to pay to replace it with another cheap refurb. The key is "prove".
Now, that burned up clutch example, I think you might have a problem getting H-D to fix that regardless. And unless they have eyewitnesses willing to testify, the fact that you have a hitch mounted isn't proof that you actually towed anything. In other words, I don't think I'd sweat it. Only you know if your local dealership is a bunch of azzholes who might try to screw you around over this sort of thing. If they are, find another place to do business, and if you can't avoid taking the bike to them for warranty work just remove the hitch.
Jerry