HANOVER, N.H., JAN. 16 -- Sen. Robert J. Dole (Kan.) came out of his shell in today's New Hampshire primary debate, flashing the aggressive and sometimes sarcastic style he had held in check during three previous encounters with his rivals for the Republican presidential nomination.

But it was not clear at the end of the liveliest debate of the campaign season that he had achieved either of his principal political needs in the contest here one month from today: cracking the cocoon of acceptability around the leader, Vice President Bush, or wresting the mantle as heir to Ronald Reagan's leadership from Bush's shoulders.

Dole went into the Dartmouth College debate, broadcast on public television stations across America, with his chief New Hampshire strategist, Thomas D. Rath, telling him, "If you don't give voters a reason to be for Bob Dole, their safe choice is George Bush."

Bush is campaigning almost as an incumbent in New Hampshire, secure in the knowledge that here, unlike Iowa, his association with Reagan is his best insurance policy.

Dole responded to the Rath challenge with his most assertive performance of the campaign, zapping Bush's record and statements on Social Security, budget policy and financial disclosure. The transformation delighted Rath, who saw "the dynamic of the campaign changing," not just because of Dole's tactics but because Rep. Jack Kemp (R-N.Y.) and former Delaware governor Pierre S. (Pete) du Pont, scrambling to survive the first primary, made Dole as much of a target as Bush.

The other two candidates -- former secretary of state Alexander M. Haig Jr. and former television evangelist Pat Robertson -- tended to fall out of the debate, as most observers see them slipping to the back of the pack in the primary here.

Bush appeared content to stay above the battle, deliberately adopting a calm tone of voice in the quarrelsome exchanges among Dole, Kemp and du Pont, and speaking only at the end of each flurry as the self-designated "cleanup hitter."

He is playing from a position of strength. Not only does he have the strongest organization in New Hampshire, but he has hoarded more of his television dollars than any of the others for the closing four weeks.

New Hampshire Gov. John H. Sununu (R), Bush's top supporter here, said that in addition to Bush's personal support in a state where he has probably shaken more hands than any other living politician since the campaigning that gave him second place to Reagan in the 1980 primary, he is sustained by the fact that "this is strong Reagan country."

On almost every question today, Bush brought Reagan into his response, portraying himself as one who would defend or continue or build on Reagan's policies.

Unlike in Iowa, where the latest polls show Dole widening his lead over Bush, Reagan is enormously popular with the Republican voters. A recent Boston Globe poll showed Bush the overwhelming choice of those who approve of Reagan's record, while Dole's support in this prospering state was concentrated among the minority of Republicans and independents critical of Reagan's policies.

The message Dole needs to deliver here is almost the reverse of his Iowa appeal -- where he can safely and profitably differentiate himself from Bush and Reagan.

Dole's efforts to redefine himself in New Hampshire terms were hampered today by his need to defend himself from repeated attacks from du Pont and Kemp on his support of an oil import fee and his record of "softness" on tax hikes.

The attack was anticipated by the Dole camp, but Sununu reveled in the development. "We can use those issues very effectively," he said after the debate, noting that in the record cold weather of the past week, anyone advocating oil taxes "can hardly portray himself as 'one of us,' " as Dole advertisements describe him.

Crunch time for the somewhat smug Bush campaign will come in the final eight days, if Dole wins his anticipated victory in the Feb. 8 Iowa caucuses. Down 15 points in the latest Gallup poll here, Dole is already within striking range of Bush. And by pressing Bush, apparently successfully, at the close of today's debate to face the field again in a League of Women Voters debate on Feb. 14, Dole set the stage for a dramatic showdown with the vice president.

Bush strategists had rejected the debate, but Andrew Card, his New Hampshire manager, said after the debate, "I would anticipate he will be there."

Kemp and du Pont also used the debate as a chance to build momentum for the final month of the primary that could be a final test of the viability of their candidacies.

Kemp had been cheered by evidence that his recent TV blitz on taxes had pulled him out of the doldrums. A Gallup poll released earlier in the week showed him up to 15 percent, only 8 points behind Dole and well ahead of du Pont, Robertson and Haig.

Paul Young, Kemp's manager, said the ad blitz between Dec. 30 and last Sunday was designed to improve the candidate's name recognition and "make clear the differences between Kemp and the Old Guard pair {Bush and Dole}" on taxes, oil prices and Social Security.