The Carter administration and the consulting industry joined yesterday in attacking proposed legislation that would tightly restrict the federal government's practice of hiring out for goods and services.

"You cannot legislate sound management controls," said Karen Hastie Williams, a senior official of the Office of Management and Budget, in testimony before the final hearing of a subcommittee headed by Rep. Herbert E. Harris II (D-Va.). "That is the responsibility and duty of the agencies, with appropriate guidance and direction of OMB."

Harris and other supporters of a bill to restrict hiring consultants for federal work, have accused OMB of letting federal agencies run away in the hiring of outside help, some of it involving clear-cut conflicts of interest.

Williams' testimony was followed by similar attacks by three officials of a coalition of 23 associations that represent consultants and contractors.

The bill, cosponsored by Harris and Sen. David Pryor (D-Ark.), "would destroy professional services, end contracts by the federal government and result in a four-fold increase in the civil service," said Dr. George A. Daoust, chairman of the coalition's legislative committee. Daoust is also director of governmental relations for Planning Research Corp., a major government contractor.

In the middle of the attack on his bill by Daoust and two other officials of the coalition, Harris read aloud a letter from the president of one of the coalition's groups, criticizing Harris.

"For some time, Congressman Herbert Harris of Virginia's Eighth District has been conducting a campaign which ultimately will destroy the professional services industry," wrote George E. Monroe of the National Council of Professional Services to the group's members.

Monroe, who is vice president of Planning Research Corp., with headquarters in McLean, also said, "Don't you think it's time to join the battle (against Harris and other critics)?"

After the hearing, Daoust apologized to Harris in private, Harris said.

Strong support for the legislation came from Adm. HYMAN G. Rickover, who said in 20 years of designing and building America's nuclear fleet, he hardly ever had to turn to consultants.

Reiterating criticism he made before a Senate panel a week ago, Rickover said, "If all the consultants were grounded today, I don't think the body politic would be harmed one bit."

Support for the legislation -- which would require that consulting expenses be listed explicitly in budgets and provide for strict conflict-of-interest safeguards -- also came from Congress Watch and Energy Action, two public interest groups, and the National Taxpayers Union.