When historians assess the successes and failures of the Reagan presidency, they may discover that its real heroes were Republicans in the Senate rather than the White House.

Budget Committee Chairman Pete V. Domenici (N.M.) has been saving the administration from itself for years with budgets that bear a reasonable relationship to reality. This year, his Senate budget steers a useful middle ground between the military extravagance favored by Reagan and the Pentagon and the defense rollback advocated by the House.

Finance Committee Chairman Bob Packwood (Ore.), whose independence has often been the despair of Reagan, has become a White House favorite after maneuvering a radical tax overhaul measure through his committee. And Foreign Relations Committee Chairman Richard G. Lugar (Ind.), attempting to rescue a botched White House political effort, is trying to save the $354 million arms sale to Saudi Arabia from an embarrassing veto override.

Senate leaders were sometimes lampooned by White House officials in Reagan's first term as "the college of cardinals." In the second term, the Senate realism on defense and tax issues was initially derided and ignored.

Increasingly, however, the president and his aides have realized that there wouldn't be much to show for Reagan's agenda if not for the efforts of Senate Majority Leader Robert J. Dole (Kan.) and his pragmatic colleagues. Speaking of the Senate leaders, a senior White House official said recently, "They've carried a lot of water for us and on other occasions have kept us from spilling some."

The efforts to control the spillage began in 1982 when Sens. Howard H. Baker Jr. (Tenn.), then majority leader, and Paul Laxalt (Nev.), a valued conduit between Senate and White House, endorsed a tax increase, disguised as a loophole-closing "tax reform," that raised some of the revenue given away in Reagan's vaunted income tax reduction bill in 1981.

Another first-term contribution was less advertised but even more important. Late in 1983, after the catastrophic suicide-bombing of Marine headquarters in Beirut, Senate leaders quietly made it known that keeping the Marines in Lebanon invited a Republican political disaster in 1984. Reagan, remembering Vietnam, declared victory and brought the Marines home.

In the second term, the Senate leadership has continued to provide wise counsel and to help the president cut his losses. When Reagan was digging in against South Africa sanctions, Dole and Lugar worked with then-national security affairs adviser Robert C. McFarlane to persuade the president to modify his course. Laxalt and Lugar brought back reports from the Philippines that enabled the administration to get abreast of a revolution it had opposed. The Senate role in foreign policy is now especially vital because the present national security adviser, John M. Poindexter, is largely a wartime consiglieri with little knowledge of Capitol Hill.

Three working relationships stand out. One is Laxalt's friendship with Reagan, the product of 20 years of trust. Another is the understanding between Secretary of State George P. Shultz and Lugar. The third, least likely and most necessary, has grown between Dole and White House chief of staff Donald T. Regan. The two men were antagonists when Regan was treasury secretary and Dole was Senate Finance Committee chairman. When they took over their new jobs in 1985, Regan's highhandedness and Dole's inability to resist damaging one-liners produced an unproductive coolness between the Senate and White House.

Happily for the president, Regan has learned a lot about the Senate, and Dole has curbed his tongue. Within the White House, it is now Regan who reminds others of the value of consulting in advance with Dole and with House Minority Leader Robert H. Michel (R-Ill.).

Except for two years in the Eisenhower administration, Republican presidents since Herbert Hoover have not enjoyed the advantage of working with a Senate controlled by their party. Reagan has made much of this advantage, and the Senate has made him look good.

Reaganism of the Week: In a letter to Shiloh Baptist Church of Washington praising the church's Women's Day program, First Lady Nancy Reagan wrote: " . . . I am reminded of a special saying that goes, 'A woman is like a tea bag. You never know her strength until she is in hot water.' "