I've seen the local dealership use an instrument that can detect layers of paint as they scan the instrument across the various body panels. On an undamaged car, the readings are uniform. Otherwise, a repaired panel shows a different reading. Some older cars may have been repainted due to age, so a repaint may not always mean that there was damage.
An old trick was to use a magnet. Some repairs are done using bondo, if the repair can be done without replacing a body panel. Typically done on lesser makes and cheaper, but quite possible done on an MB if the customer wasn't picky. The magnet does not adhere to the non-metallic bondo'ed area, thus revealing the repair.
2009 ML350 (84K) - Family vehicle
2001 CLK430 Cabriolet (71K) - Wife's car
2005 BMW 645CI (124K) - My daily driver
2012 Mustang V6 (60K) - Daughter's car