Members of Congress and the Reagan administration are dickering over legislation aimed at encouraging pension funds to put more of their assets into mortgages.

Sponsors say they still hope to get such a measure passed in Congress' lame-duck session this year, but getting a compromise may be the key to making this possible.

Already, 265 House members and 20 senators have cosponsored legislation that would eliminate a wide range of Department of Labor restrictions on private pension fund investments in mortgages, but would not require pensions to make those investments.

The administration has come up with a counterproposal that would eliminate fewer of Labor's restrictions.

In commenting on the congressional proposal, Labor Secretary Raymond J. Donovan emphasized safeguards to the financial integrity of the pension funds, saying that protection of retirement plans would have to take precedence over the needs of the housing industry and homebuyers.

Backers of the original proposal said they will try to negotiate a compromise before Congress returns.

Whether the pension funds actually would want to put their money into mortgages if the restrictions are removed is questionable, however. Until now, pension fund managers -- except those associated with the building trades -- have not shown tremendous interest in doing this. Despite some easing of regulations earlier this year, there was no immediate rush by the funds to invest in mortgages.

Private and public pension funds combined are estimated to have more than $600 billion in assets. But, so far, only about 3 percent of this amount is being put into mortgage-related investments.

Nevertheless, the housing industry and the Reagan administration are counting on the funds taking a new look at mortgage investments and eventually putting more of their vast resources into them.

Department of Housing and Urban Development Secretary Samuel R. Pierce and leaders of the housing industry, in fact, have gone so far as to say that pension funds are the only large potential source of new mortgage money. They expect the problem of mortgage availability to worsen as savings and loan associations, the traditional source of mortgage financing, try to diversify to avoid the kind of huge losses they have suffered in recent years from long-term low-interest mortgages in their portfolios.

The legislation to end most Labor restrictions was introduced by Reps. Ron Wyden (D-Ore.), Richard Gephardt (D-Mo.) and Barber Conable (R-N.Y.) in the House and by Sen. John Chaffee (R-R.I.) in the Senate. Easing regulations would not cost the government anything, they pointed out in offering the measure.

Among the restrictions the original bill seeks to remove are these:

Pension fund managers cannot decide on their own to make mortgage security investments, but must turn this decision over to an independent fiduciary. This restriction applied only to mortgage investments.

Pension plans cannot participate directly in the mortgage market, but must make investments through a mortgage lender.

Pensions cannot make investments in conventional mortgage securities packaged by private mortgage bankers, about 40 percent of the market, and cannot invest in multifamily housing.

"We don't think we are far apart" in the areas to be negotiated with the administration, Wyden said. But he also contended that so far none of the administration's proposals "does what the president said he wanted done," namely, get rid of government barriers to pension fund investment in mortgages.

He said he still hopes to get the measure put on a list of noncontroversial bills that can be taken up quickly on the House floor during the lame-duck session.

But Mark Gorman, a spokesman for Chafee, said it will be "an uphill battle" to get it through the Senate during the year-end session, particularly since two committees have jurisdiction over it.

There is "a lot of interest in Congress in doing something with" the legislation, but people who are responsible for pension fund policy have problems with it because their main concern is protecting the integrity of the funds, not stimulating housing, Gorman pointed out.

"Homebuilders think the administration proposal is too restrictive. But it's not just a housing bill when you're amending ERISA the Employe Retirement Income Security Act . You have to think about pensioners, too," he said.

"A go-fast approach will make pension funds queasy. If there is any hint of abuse, the pension funds wouldn't invest at all. We have to bring the pension funds into it a little more than we have," Gorman said.