Dons goalkeeper Stuart Searle, a late replacement for Dave Martin who suffered an ankle injury in the warm-up, denied both Anthony Wordsworth and Kayode Odejayi.
But Steven Gillespie gave the Us the lead just before the half hour when he controlled and curled in from 10 yards after Mat Doumbe had inadvertently helped on Wordsworth's cross inside his own area.
However, Dons were level less than three minutes after half-time when Baldock finished neatly from close range after being picked out by Stephen Hughes following a sweeping move.
After goalkeeper Ben Williams had denied him twice in the space of two minutes, Baldock netted again in the 62nd minute when he finished smartly from Daniel Powell's incisive pass.
And he completed his hat-trick with four minutes to go when he converted from the edge of the area after Williams had parried Luke Chadwick's shot.