Luke Howell's goal five minutes from time at Edgar Street sealed third place for MK Dons.
But already relegated Hereford made their visitors, alongside whom they were promoted from League Two last season, fight all the way for the points.
There was little to cheer the spectators during a dull first half which had end of season written all over it.
Hereford carved out the best chance of the first period with only four minutes played.
Marc Pugh made good ground down the left and crossed to Jennison Myrie-Williams who fired in a fierce drive which was well grasped by Willy Gueret.
The Dons, who were fielding a below-strength side, created their first chance in the 19th minute when a sloppy pass by Ben Smith was intercepted by Shaun Cummings who cracked his shot wide of the target.
Peter Leven also fired wide with the Dons' only other opportunity of the first period.
The second half opened much more brightly and Peter Gulacsi did well to turn a Sam Baldock 30-yarder away for Dons' first corner of the match.
But the clearest of the chances in an entertaining second 45 minutes fell to Hereford.
Pugh eased around the back of the Dons' defence to lay on a chance for Steve Guinan but Hereford's top-scorer cracked the ball over the top with only Gueret to beat.
Myrie-Williams then rounded Gueret only to see his shot cleared off the line by Cummings when a cross could have picked out a colleague in a better position.
Hereford were made to pay for their wastefulness just when the match seemed to be fizzling out into a goalless draw.
Tore Andre Flo flicked Howell through and the midfielder fired home a crisp shot for the edge of the area to settle the issue.