Senate Majority Leader Robert J. Dole (R-Kan.), in a blunt warning to Defense Secretary Caspar W. Weinberger, said yesterday that Republican efforts to reduce federal deficits are in "real trouble" unless the growth in defense spending is held down.

Weinberger rejected Dole's comments, according to a spokesman who said the defense secretary feels that those who seek to lower the military budget want to weaken "the security of the country."

In a breakfast speech to a public relations group, Dole said President Reagan risks losing the domestic spending cuts he wants unless the Pentagon is willing to compromise on defense. "I can tell you that unless we do more on the defense side we aren't going to do much on Medicare, Medicaid or anything else," Dole said.

Dole, spearheading the drive for massive deficit reductions in Congress, skirted the edge of sarcasm when he noted that the Pentagon has received huge increases in the past few years and "the rest of the country has to survive too."

Michael I. Burch, Weinberger's chief spokesman, said Weinberger not only will not back down but also will "take his case to the people" with a Cable News Network television speech Monday night.

"Secretary Weinberger feels that those who hope for 'success in bringing down the defense budget' really mean success in weakening the security of the country," Burch said. "Cutting defense does not solve the deficit problem. Cutting defense means the loss of national security, the loss of jobs and the loss of taxes."

Dole began the round of GOP infighting with a warning -- his strongest yet on defense spending -- that Pentagon resistance to a slowdown in its military buildup, which some of his GOP colleagues called "stonewalling" earlier this week, is jeopardizing joint Senate-White House efforts to cut deficits by half, to less than $100 billion over three years.

He quoted unidentified Republican colleagues as saying, "I'm willing to go after tough areas in Medicare, Medicaid, AFDC Aid to Families with Dependent Children , all these very sensitive programs and even the Social Security cost-of-living increase , but don't count on me if Weinberger continues to sit it out."

Dole added: "That's their view. He doesn't think he's sitting it out; he thinks he's saving us, and he may be. We support him. But, yes, I think we're in real trouble if we can't get together on defense numbers."

In an especially acerbic reference to the Pentagon, Dole alluded to the big defense spending increases that Congress has approved over the past four years, including inflation adjustments that are more generous than those used for other programs, and said:

"They've been able to survive over there without much difficulty, and I'm all for that. But I think the rest of the country has to survive too."

In the three weeks since Senate Republicans began writing a plan to cut spending by more than $260 billion over the next three years, defense has emerged as the critical stumbling block.

Not only has increased defense spending contributed to the growth of deficits, but strategists figure that substantial defense cuts are necessary to win support for domestic program cuts from more liberal lawmakers.

To strike a balance, Senate Republican leaders have suggested an across-the-board freeze in new spending authority that would include defense. In addition, they are considering selective program cutbacks, many of which are expected to be proposed next month by Reagan in his fiscal 1986 budget.

But Weinberger has resisted anything more than the relatively modest cuts already approved by the administration, and such defense advocates as Senate Armed Services Committee Chairman Barry Goldwater (R-Ariz.) are balking at a defense freeze.

Dole avoided criticism of either Goldwater or Reagan, saying that Goldwater only wanted to make his own decisions on how to handle Pentagon spending, and suggesting that the president is just trying not to "expend any political capital he doesn't have to."

But he warned that eventual presidential support is essential for a congressional deficit-reduction plan.