Congress will return to town today to stage a budget finale worthy of Cecil B. DeMille; a nearly $40 billion production featuring up to 250 scheming stars, some unexpected plot twists and lots of corpses on the stage before the curtain falls.

At issue are similar but somewhat divergent versions of the unprecedented budget "reconciliation" legislation that the two houses approved in a stunning victory for President Reagan before they left for their Fourth of July recess nearly two weeks ago.

The spectacular nature of the impending House-Senate conference on the spending cuts arises not so much from the differences between the two bills, which are relatively minor, as from the scope of the legislation.

The significance of the conference in terms of substantive decisions dimmed just before the recess when the Democratic-controlled House jettisoned recommendations of its committees in favor of Reagan-blessed cuts that closely paralleled those approved by the Republican Senate. But it will still be by far the biggest congressional conference in history, involving members from nearly every major committee.

The reason for this is that, aside from defense spending, which will be increased dramatically, hardly a federal program escapes unscathed in the reconciliation legislation. Especially hard hit are programs for the poor that were adopted since Lyndon Johnson launched his drive toward a Great Society a decade and a half ago. Chief among the billion-dollar losers were health, education, housing, welfare, jobs and feeding programs.

The cuts, put by preliminary estimates at roughly $37 billion for the House and $38 billion for the Senate, were made to keep spending within the $695.5 billion budget target that Congress adopted in May. This is $34 billion more than Congress' spending limits for the current fiscal year but less than half as much of an increase as would have occurred without the program cuts.

Although congressional budget officials say that from 150 to 250 legislators could be involved in the conference, which probably will start in earnest next week, the actual work is expected to be done in two or three dozen sub-conferences composed of members of affected committees. "Resolving the differences may turn out to be less difficult than finding meeting rooms," noted one official.

It is also possible that a preconference concession by the Senate could clear the decks, at least a little. Senate leaders yesterday were discussing the possibility of adopting large chunks of the House-approved measure that dovetail with Senate-adopted provisions. This would clear some clutter from the conference and, according to House Republicans, lessen the maneuvering room for House Speaker Thomas P. O'Neill Jr. (D-Mass.) and other Democrats who are still looking for ways to salvage favored programs.

Most of the major difference arises from programs under the jurisdiction of the House Energy and Commerce Committee, the one area where Democrats succeeded in leaving their stamp on the legislation. Included are energy programs, Medicaid funding and health block grants.

Although Reagan got most of what he wanted from both houses, he had to settle for half-loaves in the block grant area. Many small education, health and social service programs will be consolidated into lump-sum, few-strings payments to the states, but many of the biggest programs were kept as separate entities and some strings were kept in place.

So hasty and chaotic was House action on the cuts that many legislators are still unfamiliar with the results, and errors have been popping up that will have to be resolved in conference. Moreover, both houses included non-budgetary items that the conferees may want to strike. The conference is scheduled to complete its work before the month-long August recess, but it is possible that, with Reagan's tax cut legislation also on the docket for July, Congress will have to delay its recess or postpone final action on the cuts until September.

These are some of the major similarities and differences in the House and Senate versions of the legislation:

Health: The Senate would save about $1 billion by "capping" federal payments to the states for Medicaid but would allow a 9 percent increase next year, nearly double what Reagan wanted. The House would achieve its Medicaid savings by other forms of cuts. The Senate retained Professional Standards Review Organizations (PSROs), which review local medical practices to hold down costs, while the House would phase them out as Reagan asked. Both houses would make Medicare beneficiaries pay more of their medical costs, the Senate more than the House.

Social Security: Both houses voted to eliminate the $122 monthly minimum benefits, which would mean a reduction in benefits for about 1.5 million people, according to the House Ways and Means Committee. Student benefits would also end, as would the $255 lump-sum death benefit in cases where there is no surviving spouse or child. The Senate also proposed new eligibility restrictions for disability benefits.

Education: The House imposed a "means test" for the rapidly expanding college loan program, limiting aid to actual educational costs, minus an anticipated family contribution and other forms of assistance; this would affect an estimated 1.3 million students. The Senate would impose such a test only for families with annual incomes exceeding $25,000. New fees would be imposed in both versions, and interest rates on loans to parents would be raised. Grants to poorer students would be heavily cut. Both houses cut the program of impact aid to local school districts by about half, limiting it largely to districts serving military families.

Welfare: Both houses tightened eligibility rules for Aid to Families With Dependent Children (AFDC) and reduced benefits to familes with incomes from work, saving more than $1 billion. States would be allowed to establish "work fare" programs requiring work in exchange for benefits.

Food stamps and nutrition: Both houses tightened eligibility requirements and reduced future benefits for food stamps, although in somewhat different ways, adding up to Senate savings of $1.9 billion and House savings of $1.5 billion. About $1.5 billion would be cut by both houses from school lunch and related programs, reducing the subsidy for paid lunches and raising eligibility levels for free and reduced-price lunches.

Employment: Both housed voted to wipe out the once quite large public service jobs program under the Comprehensive Employment and Training Act (CETA), saving $3.6 billion. To save more than $1 billion more, they would also restrict unemployment insurance in a number of ways, in particular by repealing the so-called national "trigger" extending the standard 26 weeks of benefits for another 13 weeks when unemployment is high. Another $1.3 billion would be cut by both houses by requiring that unemployment benefits be exhausted before workers who lose jobs because of imports can claim trade adjustment assistance.

Housing: Both houses voted to reduce drastically the number of planned new subsidized housing units (150,000 for the Senate and between 158.000 and 162,500 for the House, compared with 260,000 recommended by the Carter administration). They also would require tenants to pay a higher percentage of their income for rent; the expected contribution would rise from 25 to 30 percent in the next five years. The Senate also wants to tighten eligibility for new tenants in subsidized housing and proposes to curtail housing aid to cities like New York and Washington that practice rent control.

Federal workers: Both houses would limit pay raises for federal workers to 4.8 percent next year, saving $3.7 billion. They also voted to eliminate one of the two annual cost-of-living increases for military and civilian government retirees, saving nearly $1 billion.

Postal: Both houses cut nearly $1 billion from postal subsidies, although the House scrapped its controversial idea of closing up to 10,000 small post offices. The House wants to block the proposed nine-digit Zip Code; the Senate voted against doing so.

Energy: Neither house included in the budget the $3.9 billion required to help fill the Strategic Petroleum Reserve next year, which critics say amounts to deceptive savings. The House put oil purchase costs back in the budget for 1983 and 1984, but the Senate did not. The House, unlike the Senate, repealed legislation requiring utilities and industries to stop burning natural gas after 1989 and revoked federal authority to force energy-performance standards for new construction. The houses reauthorized energy programs in markedly different ways although both would continue development of the Clinch River breeder reactor.

Commerce and development: Both houses would cut back the Export-Import Bank's lending authority, but not nearly as much as House committees originally proposed. The Senate retained all Urban Development Action Grants as a separate program; the House did not. Both eased federal controls over community development spending. The Senate included radio and television deregulation; the House didn't.

Environment: The Senate refused money for sewer construction grants, as Reagan wanted, while the House voted to keep the program alive, barely. Both houses, in different ways, provided more money for park acquisition than Reagan wanted and refused to go along with his proposal to kill the Water Resources Council. The House barred federal flood insurance for undeveloped barrier islands; the Senate did not.

Miscellaneous: Both houses cut back but continued the Legal Services Corporation, which Reagan wanted to abolish. They sharply reduced Amtrak, Conrail and mass transit subsidies but would keep Amtrak rail passenger service operating in more than just the Northeast Corridor. There are major House-Senate differences over the timetable for selling Conrail. Other cuts run the gamut from foreign aid to farmers' loan programs to arts and humanities endowments.