The General Accounting Office has asked Health and Human Services Secretary Margaret M. Heckler to investigate whether two dozen labor and welfare advocacy groups violated federal law or used federal funds when they organized demonstrations against the Reagan administration's "workfare" policies last year.

Similar requests have been made of Labor Secretary Raymond J. Donovan and of the Legal Services Corp. The GAO was asked to look into the matter by a member of Congress, whom it declined to identify.

In its letter to Heckler, the GAO included an article from the February, 1983, edition of Jobs Watch, a publication of the Jobs Watch project of the Catholic University Law School Center for National Policy Review. It dealt with demonstrations that were directed against the requirement that some welfare recipients work for their benefits. Both the food stamp and Aid to Families with Dependent Children programs have workfare provisions.

The GAO said that the food stamp amendments of 1980 prohibit the use of federal funds "to interfere with or impede the implementation of the Food Stamp Act as amended," which includes the workfare provision.

Citing a report of the House Agriculture Committee, the GAO also said that while certain types of advocacy activities are clearly legal, "counseling recipients to hassle or harass state and local officials" and other "illegal, non-First Amendment activities" are not. It said that the latter could include "violence, threats of violence, intimidation of public officials or mass demonstrations."

William L. Taylor, director of the Center for National Policy Review, said yesterday, "It is quite improper for the GAO to call for an investigation and the possible defunding of groups that have done nothing more than assist the poor and exercise their constitutional rights to petition government for redress of their grievances.

"The Jobs Watch report does not contain even a hint of illegality. The GAO knows that the food stamp amendments prohibit only efforts to intimidate or harass government officials."

The GAO said that once it receives responses from HHS and the other agencies, it will try to judge whether the food stamp law or any other federal law was violated. It will then simply forward that information to the member of Congress who requested it.

There is substantial concern within HHS that the home health program could mushroom far beyond its original purpose and begin costing, rather than saving, federal funds. With spokesmen for the elderly anxious to improve services, the issue of how much to expand home health care is expected to remain controversial.

Under the home health program, Medicare pays for certain types of skilled nursing services and therapy provided to patients at home. There are now about 3,800 home health agencies participating in the program, according to an HHS memo circulating within the Health Care Financing Administration, the HHS agency that runs Medicare.

Originally, according to the memo, the home health benefit was intended to provide care for people after they were released from a hospital. The theory was that it would be cheaper to provide certain care at home than in a hospital.

However, according to the memo, the program is beginning to assume some of the characteristics of a broad program for long-term care of the elderly. Congress recently has relaxed some of the program's restrictions, and at the same time, according to some HHS officials, people are sometimes being reimbursed for custodial care rather than skilled nursing care.

The result, the memo stated, is that for the 10 years that ended in 1982, federal outlays for home health care increased by an average of 31 percent annually. From $81 million in 1969, the program is expected to cost $1.5 billion in 1983 and $2.6 billion by 1988.

A GAO study last December concluded that while client-reported satisfaction was improved by the program, "these services, however, did not reduce nursing home or hospital use or total service costs."

One reason, the GAO said, could be that broader coverage and eligibility in some cases result in the government paying for care that otherwise would be provided by relatives.