Rochdale 2 Hereford United 4
The home side got off to the best possible start when Simon Ramsden headed them in front after just seven minutes but errors by Rory McArdle and John Doolan saw MacDonald, on loan from West Bromwich Albion, bag a 17-minute hat-trick to make it five goals in two games for the Bulls.
On 14 minutes he turned home a Gary Hooper cross, finishing crisply from 12 yards out.
Ten minutes later McArdle's mistake allowed MacDonald to race well clear of the Dale defence and give Hereford a lead that they never looked like relinquishing.
His third came 31 minutes in when a Simon Johnson cross found the Dutchman who made no mistake from close range.
Either side of the break the home side were unlucky to see efforts strike the woodwork but the game was ended as a contest after 72 minutes when MacDonald turned provider and fellow striker Gary Hooper finished clinically.
The home side scored no more than a consolation goal in time added on when striker Rene Howe headed home from close range from a Kallum Higginbotham corner.
Rochdale have now lost three successive games to slip out of the play-off positions whilst Hereford profited from a loss by Rotherham to cement their place in the top three.