After Martin Olsson had been brought down on the left side of the area, McCarthy's curling right-footed cross appeared to evade everyone in the box and nestled in the far corner beyond Paul Smith's desperate dive.
It was harsh on the Championship club, who created the better chances throughout and missed a second-half penalty when Jason Brown superbly saved Dexter Blackstock's kick.
Allardyce made 10 changes from Sunday's dismal defeat at Everton with former Real Madrid defender Michel Salgado the only survivor.
Blackburn were slow out of the blocks and Forest almost forged a fortunate early lead after Blackstock was fouled 30 yards out.
Chris Cohen's free-kick to the far post was headed back across goal by Blackburn-born Joe Garner, a former trainee with Rovers, before Blackstock unknowingly guided the ball goalwards with his thigh but Brown was on hand to smother.
Nathan Tyson showed his pace down the left to set up a 10th-minute chance for Robert Earnshaw. The Wales international controlled the low cross but had the ball nicked off his toe by Rovers captain Ryan Nelsen as he was about to shoot.
Forest went close after another Cohen free-kick was not properly cleared. The ball ricocheted into Wes Morgan's path but the defender blasted his first-time effort wildly wide.
Blackburn stretched the home defence for the first time after 20 minutes when David Hoilett got down the left to cross, but Nikola Kalinic got his header all wrong and the ball looped harmlessly onto the roof of the net.
Forest continued to look dangerous and skipper Paul McKenna sent a rising shot just past the top corner midway through the first half.
Blackstock would surely have scored had pressure from two Blackburn defenders not caused him to lose balance and mis-hit his 10-yard shot in the 26th minute.
Hoilett and Kalinic combined again just after the half-hour. This time the Croatian's downward header had Smith scrambling across his goal but the ball bounced narrowly wide.
Rovers took the lead eight minutes before the break but the hosts came close to equalising through a free-kick of their own when Earnshaw's curling effort clipped the bar.
Forest emerged after the break lacking the fluency they had in the first half and took time to get going.
McCarthy should have scored his and Blackburn's second goal 10 minutes after the restart following hesitation in the home defence, but he directed his glancing header wide.
Brown had to get down quickly to take Joel Lynch's whizzing low cross off the toes of the arriving Blackstock and Earnshaw soon afterwards.
Tyson then sent a low shot narrowly wide just after the hour after cutting inside from the flank before Cohen's mis-hit cross had to be pushed over the bar by Brown.
Billy Davies' side were gifted the chance to equalise in the 72nd minute when Steven Reid mistimed his jump to head clear and the ball struck the Republic of Ireland player's flailing arm, leaving referee Michael Oliver with little choice but to award a penalty.
Blackstock stepped up but his spot-kick was superbly pushed away by Brown, diving to his left.
The hosts continued to push for an equaliser and many of the 11,553 inside the City Ground thought they had got it in the final minute when a cross was flicked on at the near post, but Earnshaw somehow managed to scoop the ball over the bar from on the goalline.
To the Welshman's relief, the offside flag had been raised.