Summer signing Kevin Nolan's fifth-minute strike, his first for the Hammers, was enough to ensure the promotion favourites bounced back from their 1-0 opening-day defeat to Cardiff.
But, after a dominant first half at the Keepmoat Stadium on Saturday, Allardyce's side had to withstand several nervous moments after the interval as they dug in for victory against a Rovers side beset by injury.
Allardyce started transfer target Scott Parker, whose industry will be sorely missed if, as expected, he departs, at the heart of a 4-5-1 formation that served to control the opening 45 minutes.
The cautious approach was aided by their early goal as Nolan opened his Hammers scoring account in style.
Jack Collison, the only change from last weekend in place of Freddie Sears, perfectly weighted a lofted diagonal pass to find Nolan's run to the back post where he prodded home on the volley.
The former Newcastle midfielder then came close to doubling his tally after 17 minutes when his first-time shot from 30 yards almost caught out home goalkeeper Gary Woods, who recovered quickly enough to touch it onto the crossbar.
It was evident early on Allardyce's formation, with Frederic Piquionne the lone striker, was swamping Doncaster's preferred passing game.
Parker's industry ensured he continually picked up loose balls and with his fellow midfielders offering willing support for Piquionne, West Ham posed a measured, if not constant, attacking threat.
Collison had an effort blocked while James Tomkinson and Matt Taylor both headed over.
To Doncaster's credit they patiently maintained their passing approach but with the midfield suffocated they did not fashion a single shot on target in the first half.
After the interval the hosts found more joy attacking down the wings and after winning a free-kick out wide Giles Barnes headed John Oster's delivery wide.
A James Coppinger cross then needed a timely clearing header from Joey O'Brien, while Parker's awareness of the growing danger was required when he charged down a Chris Brown shot.
Doncaster's improvement forced Allardyce to discard his half-time coffee and get off his bench for the first time as he barked instructions to his under-fire side.
Now agitated Allardyce brought on Carlton Cole for the ineffectual Piquionne and the striker immediately forced a save with a header before crashing another shot into the side-netting.
Doncaster were, however, the more likely scorers and broke down the right only for Coppinger to cut the ball back into a vacant six-yard box.
Coppinger then headed agonisingly wide of the far post from another cross, this time from the impressive Mustapha Dumbuya, before Robert Green denied Simon Gillett at close quarters.
With time ticking down the visitors thought they had won a penalty when George Friend challenged Cole in the air.
Allardyce was clearly unhappy as he raised his arms in dispute on the touchline, but the 56-year-old was soon a relieved man as referee Scott Mathieson blew full-time on his first win.