Maryland Democratic Rep. Michael D. Barnes, who represents much of Montgomery County, released a survey this week that he said indicates strong opposition among county residents to cuts in social programs and considerable support for restraint on defense spending.

Survey forms were distributed to people attending a community forum on the budget last month; 313 questionnaires were filled out and returned.

Sixty percent of those responding favored a freeze on all defense and domestic spending, except for cost of living adjustments for social security, federal retirement and programs for the poor such as food stamps, Barnes said.

About 75 percent of those responding opposed a one-year elimination of the cost-of-living adjustment for social security recipients and for retired federal workers.

Montgomery County has a high percentage of federal workers, and the Reagan administration's proposed 5 percent pay cut for that work force is unpopular there, the survey showed. Of those responding, 85 percent opposed a pay cut, while more than half (57 percent) favored a one-year freeze in federal salaries.

Reagan's effort to raise defense spending garnered little support from those answering the survey. A freeze in defense spending was supported by 85 percent.

The majority also were opposed to Reagan administration proposals to cut or eliminate certain federal assistance programs, such as federal aid for college students (62 percent); general revenue sharing (67 percent); Legal Services Corp. (83 percent) and school lunch programs (83 percent).

There was strong support for certain revenue-raising measures, such as user fees and high cigarette taxes.

An overwhelming majority (95 percent) favored keeping the federal cigarette tax at 16 cents, instead of allowing the scheduled reduction to 8 cents. There was similar support (93 percent) for increasing the corporate minimum tax. In addition, more than half (58 percent) supported reductions in income tax credits, deductions and preferences.

There also was support for imposing user fees on boat owners for the cost of Coast Guard services provided to recreation and commercial mariners (84 percent); for increased fees for public use of national parks and forests (59 percent) and for a $5-per-barrel tax on imported oil (65 percent).

Those responding to the survey split evenly on the question of whether the indexing of income tax rates according to inflation should be repealed.