House and Senate conferees yesterday agreed to a compromise 1978 budget goal that provides for $118.5 billion in defense funding, about $5 billion less than President Carter's request.

The long, three-day conference session almost broke down several times as the Senate tried to keep the level near its proposed $120.3 billion for defense, while the House tried to hold to its $117.1 billion proposal.

At no time was there specific debate about what, if any, defense programs would be sacrified at the lower spending level, although congressional defense experts said later most of it presumably would have to come in the weapons procurement area.

The debate was mainly a "symbolic" rather than a "real" one, said House Budget Committee Chairman Robert N. Giaimo (D-Conn.).He said the difference of about $2 billion in a $120 billion item would not have significant impact on Pentagon operations.

But House conferees were concerned that if there was much of an increase for defense opening, they would not be able to get a conference report approved on the House floor.

Two weeks ago the first version of the House's preliminary budget for fiscal 1978 (which starts Oct. 1) foundered because it contained too much defense spending for liberals and too big a deficit to satisfy conservatives. House leaders blamed President Carter for lobbying too hard for a big defense boost.

The budget that conferees agreed to yesterday - which Congress then uses as a guide in allocating funds over the summer - is only a target. Congress must pass a final, binding budget by Sept. 15.

The conference compromise, which both Giaimo and Senate Budget Committee Chairman Edmund S. Muskie (D-Maine) said they think will be approved, contains a deficit of $64.65 billion, $1.8 billion smaller than the initial House version and $1.2 billion bigger than the Senate version.

Carter has recommended a 1978 budget with a deficit of $57.9 billion. The congressional version proposes to spend $460.95 billion overall, which is actually $1.65 billion less than the Carter recommendation, but because the President anticipates $8.4 billion more in tax receipts than Congress does, his deficit is smaller.

The approves budget contains $27.2 billion for eduation, $146.7 billion for income security programs such as Social Security, $20.2 billion for veterans' programs and $44.3 billion for health programs. Budget drafters agree that the $20 billion they allocated for natural resources and energy may have to be substantially revised to accomodate the Carter energy package.

Giaimo said that a leadership survey, indicates the conference report will be approved on the floor of the House when it comes up Tuesday, despite the $1.4 billion increase in defense spending and about a $1 billion reduction in spending on social programs from the original House version.

Two House Republicans signed the conference report - Marjorie S. Holt of Maryland and Ralph Regula of Ohio - the first time House committee Republicans had supported a proposed budget in the Democratic-controlled Congress since the process was started two years ago.

Lack of Republican support has forced Giaimo to fashion a majority from moderate to liberal Democrats, most of whom favor lower defense spending and high spending on social programs.

The budget procedure was set up to give Congress the ability to deal with overall spending and not to have to deal with each program on a case-by-case basis. It also requires Congress to set its overall spending priorities before it begins, appropriating funds for the next fiscal year.

Until Congress agrees to a target budget - the Senate plans to take up the conference report Friday - no spending bills of any sort can be considered on the House or the Senate floor.

The President still must recommend a budget, a powerful prod to Congress, but the legislature makes the final spending and taxing decisions.

After Giaimo complained yesterday about the difficulty in getting a high defense number through the House, Sen. Ernest F. Hollings (D-S.C.), a strong advocate of military spending, said he wondered "whether we are defending the chairman [in his political problems] or defending the country."

When the conference finally agreed to spending authority of $118.5 billion for the Pentagon after a 1-hour caucus of House Democrats, staffs of both companies broke into applause.