A record 111-run 10th-wicket stand between Bhuvneshwar (58) and Shami (51*) took India to 457, after which England reached 43/1 at stumps, losing Cook for 5.
Rearguard action from Indian tailenders Bhuvneshwar Kumar and Mohammed Shami frustrated England on the second day of the Nottingham Test, at the end of which the visitors led the hosts by 414 runs.
India slipped from a comfortable 344 for 5 to 346 for 9 when a collapse shortly after lunch gave England hopes of restricting India to under 350. But a 111-run partnership and maiden Test fifties by Kumar and Shami buried the English aspirations.
The duo batted for 38.1 overs for their century stand - India's second best effort for the 10th wicket and the best against England. James Anderson took 3 for 123 while Stuart Broad (2 for 53) and Ben Stokes (2 for 81) took two wickets each.
Shami then came on to contribute with the ball as well and extended Alastair Cook's run of bad form when he bowled the England skipper around his legs for just 5. At stumps, Sam Robson (20*) and Gary Ballance (15*) were in the middle for the hosts who had reached 43 for 1.
In the morning session, thanks to Murali Vijay's 146 runs, India were placed comfortably at 342 for 5 in 118 overs at lunch. Along with Dhoni, he survived a testing morning spell from Broad and Anderson. But the partnership was aided by wicketkeeper Matt Prior, dropping Dhoni in the third over of the day.
The duo then made England pay and brought up their 100-run partnership in the 11th over of the day and the 101st of the innings. Vijay then slowly progressed towards the 150-run mark but just one scoring shot away, he was trapped LBW by Anderson in his second spell of the morning. TV replays, however, suggested the ball might have travelled over the stumps. Vijay faced 361 balls during his superb innings and batted for nearly eight hours, hitting 25 fours and one six.
The second day's post-lunch session began in a similar fashion as day one. From 342 for 5, India lost four wickets for four runs to slip to 346/9.
Stokes took the first wicket after lunch and his first of the match when Ravindra Jadeja edged behind to Prior on 25. Anderson then ran out Dhoni (82) from mid-off when the India skipper attempted an ambitious single. Stokes then struck again, removing debutant Stuart Binny (1) when he tried a fancy square cut but found Joe Root at backward point. Ishant Sharma (1) shouldered arms to Stuart Broad and had his off-stump pegged back.
But then England's attack faltered as Kumar and Shami dug in. At tea, Kumar was unbeaten on 46 off 120 balls with four boundaries while Shami was undefeated on 39 with six hits to the fence in 62 balls. The duo frustrated England attack to the T after Dhoni's run-out sparked a collapse.
The pacemen raised their maiden Test fifties following tea and raised the 100-run stand while taking the score past the 450-run mark. India were finally bowled out for 457, with Kumar the last man to fall for 58 while trying to lift Moeen Ali out of the park.