I used to work as a buyer for Carmax, and whenever I appraised a car that I suspected had a tune, I had a conversation with the customer. We would typically recommend that a customer put the vehicle back to stock, and then have us appraise it. As a dealer, we ALWAYS wanted a car that was not modified. If a newer car had an obvious tune, our appraisal offer was always lower as the vehicle would be auctioned instead of being eligible to be sold on the front lot. How much less would depend on a number of factors, but typically at least $1k less. If the customer sold/traded the car to us with a tune and more than just a CAI or catback, we would auction the car off with an announcement of "aftermarket modifications". The few times we had to auction a car with a "voided warranty" that was discovered after the fact, we lost thousands on those. Never once did we go back after the customer for that, though. I'm not familiar with the other dealers that have customers sign anything stating that the vehicle hadn't been modified. Just speculating, but I think that's more to get the customer to admit anything instead of trying to hold them legally responsible down the road...
Different dealers will have different standards, of course. A VW dealer that would otherwise CPO the car will likely want to check to see if has been reflashed, and has the capability to do so. A non-VW dealer wouldn't likely have much concern if a vehicle was put back to stock before it was appraised, and they typically wouldn't be able to find that out. Other dealers that specialize in modified cars or private sales to individuals that are looking for a modded car would be an entirely different scenario, of course. And a car that is outside the factory warranty period is even less of a concern.
Hopefully that gives some insight as to how dealership personnel might view the topic.