The Argentinian striker was at his effortless best, despatching a fine first-half free-kick and then producing two clinical finishes either side of Gerard Pique's header.
Ajax were passengers for large parts of the 4-0 defeat and were denied even a consolation when Victor Valdes saved Kolbeinn Sigthorsson's penalty.
Messi, perhaps inspired by Cristiano Ronaldo's treble for Real Madrid on Tuesday night, now has 62 Champions League goals and a record four hat-tricks.
The Scottish champions were on course to leave the San Siro with a hard-earned point until an Emilio Izaguirre own-goal in the 82nd minute.
Sulley Muntari ensured victory three minutes later after Fraser Forster pushed a Mario Balotelli free-kick against the post.
Oscar put the Blues in front on the stroke of half-time with virtually their first chance but they lacked cutting edge to add to that lead.
Mohamed Salah levelled in the 71st minute with a wonderful strike and when Marco Streller pounced eight minutes from time it confirmed Chelsea's first home defeat in the group stages since 2003.
Atsuto Uchida opened the scoring after 67 minutes, with Kevin Prince-Boateng (78) and Julian Drexler (85) adding the gloss.
It could have been worse for Jurgen Klopp's side, who lost goalkeeper Roman Weidenfeller to a red card just before the interval following goal-preventing handball outside the area.
Napoli were already ahead through Gonzalo Higuain's 29th minute effort and doubled their advantage through Lorenzo Insigne in the 67th minute.
Dortmund got one back in the closing moments when Camilo Zuniga put the ball past his own keeper.
Theo Walcott (65) and the in-form Aaron Ramsey (84) got their goals, before an Andre Ayew penalty in added time reduced arrears.
Hulk's 58th-minute strike was the pick of the day, cancelling out Miranda's opener, but Arda Turan and Leo Baptistao were on target to render it irrelevant.