President Reagan's new $320.3 billion defense budget received a cold reception yesterday when it was unveiled before congressional committees, as lawmakers warned the administration that military spending must be cut to avoid a fiscal "train wreck" later in the year.

"The train wreck will occur in October unless we take steps now to avoid it," Sen. Sam Nunn (D-Ga.), ranking Democrat on the Senate Armed Services Committee, told an unyielding Defense Secretary Caspar W. Weinberger in a packed hearing room.

Nunn was referring to the Gramm-Rudman-Hollings law, which could require the president next fall to cut the federal budget drastically to reduce the deficit to $144 billion in fiscal 1987, unless Congress and the administration agree on a budget that precludes the automatic cuts required by the deficit-reduction law.

If those automatic cuts are triggered, government leaders believe that the defense budget will have to be cut by about $60 billion in spending authority to meet that deficit target.

But Weinberger was adamant in insisting on an 8 percent increase in Pentagon spending. Noting that Congress has trimmed Pentagon budget requests in recent years, the defense secretary said, "We have given at the office, the store and the Pentagon."

At the top of Pentagon budget yesterday was a request for $4.8 billion to finance the antimissile research program known formally as the Strategic Defense Initiative, the largest weapons program in the budget which had received $2.76 billion in fiscal 1986.

Among other requests: $1.4 billion for the Air Force Midgetman mobile missile, nearly twice the amount for 1986; $1.4 billion for Army AH64 attack helicopters; $3.5 billion for Navy F/A18 fighter planes; $1.2 billion for the troop-carrying Bradley Fighting Vehicle; $1.7 billion for the Trident nuclear missile submarine; $756 million for the controversial Air Force advanced air-to-air missile, and $2.1 billion for the M1 tank.

The Pentagon also requested a 4 percent pay raise for military personnel, effective in October, and 21 MX missiles to be used as spares. Some programs, such as new Navy minesweepers, have been slowed down to economize, but it appears that no weapons were killed outright in the budget.

In a related hearing on the budget, Rep. Les Aspin (D-Wis.), chairman of the House Armed Services Committee, told Navy witnesses that "either you guys aren't serious about defense or somebody dropped the ball over there" at the Pentagon by daring to propose such a huge budget. If Gramm-Rudman-Hollings takes effect, the defense budget will be slashed across-the-board, rather than military leaders deciding which programs are most vital, Aspin said.

The new budget will get the "meat ax" treatment unless Reagan and Weinberger help Congress cut it in the coming months, Rep. Ronald V. Dellums (D-Calif.), told Navy Secretary John F. Lehman Jr. and Adm. James D. Watkins, chief of naval operations.

Following Weinberger's unbending lead, Lehman replied, "Whether the defense structure is blown up or burned down is only of academic interest to me. We get to the same place. There's no difference in terms of our defense collapse."

"That's a tragic statement," Dellums said.

Sen. Barry Goldwater (R-Ariz.), chairman of the Senate Armed Services Committee, was one of the few lawmakers at either hearing who seemed confident that the administration and Congress this year would be able to economize sufficiently to avoid triggering the drastic cuts others see coming in the fall. Goldwater asked Weinberger to provide a list of military bases which could be closed to save money, always a touchy political issue.

In budget authority -- the money appropriated by Congress in one year but usually spent over several years as weapons' programs mature -- the $320.3 billion request included $311.6 billion for military functions, $8.2 billion for related Department of Energy nuclear activities such as warhead construction, and $510 million for miscellaneous defense activities.

The total is 12 percent more than the $286.1 Congress approved for fiscal 1986. Subtracting the projected inflation rate of 4 percent, the real increase comes to 8 percent.

In terms of money actually spent in fiscal 1987, the Pentagon wants a 6 percent increase for a total of $282.2 billion.

However, some budget analysts said yesterday that Reagan's military spending projections have been kept low to lessen the chance of triggering Gramm-Rudman-Hollings. Joshua M. Epstein, a Brookings Institution analyst, estimated that the actual spending in fiscal 1987 will be $14.8 billion higher than the administration's figures, and $66 billion higher for the next five years.

Weinberger's 336-page posture statement contained few suprises but conceded that Reagan's rearmament program differs little conceptually than that of former president Jimmy Carter. Reagan assailed the Carter defense program during the 1980 election campaign.

"The most important truth about the recent buildup," Weinberger said in his statement, "is that we have been buying and fielding forces to implement policies and strategies over which there was little disagreement between this administration and its predecessor. Our principal difference arose from our judgment about the importance of funding these programs at levels adequate to achieve our stated objectives as quickly as possible."

In one of the few exchanges about defense strategy yesterday, Weinberger and Adm. William J. Crowe Jr., chairman of the Joint Chiefs of Staff, said if the United States and Soviet Union should go to war, the United States would try to sink Soviet submarines carrying nuclear missiles even if the conflict had not escalated to nuclear warfare. Weinberger added that Soviet military leaders would be trying to sink U.S. missile submarines at the same time.