It was get-tough-on-defense week on Capitol Hill, as Republican and Democratic legislators alike warned that no weapon system will be sacred in the face of mounting budget deficits.

Defense Secretary Caspar W. Weinberger, champion of a military budget being flayed before it was even submitted, appeared paradoxically good-humored, even jaunty, according to aides. He met with senators ranging from Barry M. Goldwater (R-Ariz.) to William Proxmire (D-Wis.), warned as usual of the "growing nature of the Soviet threat," challenged a powerful House Democrat by cutting some pork right out of his district and, through it all, seemed confident that not all the tough threats would be acted on.

According to Pentagon analysts, there is more than bravado to back such confidence. Congress is almost certain to trim President Reagan's military budget request, they said, but almost as certainly will do little more than restrain the rate of growth by chipping away at hundreds of accounts.

"You think the Mississippi delegation is going to let us zero-out the LHD or the Aegis?" asked Navy Secretary John F. Lehman Jr., referring to two Navy ships built in Pascagoula, Miss. "No. We would just get fewer. Every little dog will get his little bit, and you'll just end up with higher prices."

Any move toward a defense budget freeze, analysts said, would run into the hard realities of the budget: politically valuable home-district contracts, politically powerful defense contractors and, thanks to the buildup of the past four years, a fast-growing backlog of unbreakable obligations from past budgets.

Next year, the Pentagon will spend more than $100 billion for ships, planes and other purchases that Congress already has approved. Congress has almost no control left over those expenditures, which will make up about one-third of the military budget.

"There's been a lot of barroom boasting about breaking contracts and killing weapons," one Pentagon official said. "But now the retreat begins. You've seen Cap's first little flash of the stiletto. Every congressman knows that the services are putting together lists of bases that can be closed in their districts. McDonnell Douglas and General Dynamics and anyone else with a big PAC political action committee is gathering outside their offices. And pretty soon you'll see a major push to knock off this talk of a freeze."

The difficulty of cutting the military budget is well illustrated by the growth in what the Office of Management and Budget calls "relatively uncontrollable outlays." Those "uncontrollables" have increased from about 30 percent of the defense budget in fiscal 1980 to more than 35 percent in fiscal 1985, according to OMB's estimate last year.

The rise in actual dollars has been even more impressive: from $36.5 billion in 1980 to an estimated $97.4 billion in 1985 and more than $100 billion in fiscal year 1986, which begins Oct. 1.

Another $70 billion or so of the defense budget will go to personnel costs such as pay and retirement benefits, which Congress will be loath to cut, both because of political repercussions and for fear of wounding the volunteer Army. Another large chunk, as Lehman said in an interview, goes to routine operating costs -- 35 to 40 percent of the Navy's budget, he said.

"If Congress wants to call the fleet home, you can tie 'em up and you don't spend that money," the Navy's civilian leader said. "But then you have to ask, what commitments is it that Congress wants to give up? Which do they want to give up, the Pacific or the Atlantic?"

Even the so-called "uncontrollables" can be cut, of course. Contracts can be broken and weapon systems can be killed, as Sen. Alan K. Simpson (R-Wyo.), assistant Senate majority leader, suggested this week.

But breaking or altering contracts costs both jobs, as Weinberger points out from time to time, and money. Navy officials said that the reduced growth rate already accepted by the Reagan administration will force them to ask for 18 F14 fighter jets in fiscal 1986 instead of the 24 they bought in each of the past few years, which will increase the cost of each plane by $3 million.

A House Armed Services Committee aide said yesterday that it makes more sense to kill systems before they enter production than to interrupt established programs. For that reason, he said, the defense research budget will be scrutinized closely.

But killing a program in its infancy saves little money in the first year. Similarly, closing unneeded bases -- as Goldwater, new chairman of the Senate Armed Services Committee, has suggested -- costs money in the first year, with savings showing up only in future budgets.

Rep. Les Aspin (D-Wis.), new chairman of the House Armed Services Committee, frequently has decried the congressional tendency to look for one-year savings that result in immediate deficit reductions instead of making cuts that save billions in future years. Partly to address that problem, Aspin wants to create and chair a subcommittee on policy, associates say.

But Congress will have difficulty making deep cuts in a rational way, according to both Pentagon and congressional officials. And, as usual, they can expect no help from Weinberger, who believes, according to a spokesman, that the administration's defense budget is as low as the president can recommend.

When The Washington Post reported last week that Weinberger was reconsidering a decision to base the battleship USS Iowa in New York, partly because of his irritation with Rep. Joseph P. Addabbo (D-N.Y.), chairman of the House Appropriations subcommittee on defense, other East Coast legislators jumped in.

Sen. John H. Chafee (R-R.I.), an aide said, called Lehman right away. "I want you to know that if New Yorkers don't want that battleship," Chafee said, "we do."