Although the federal government has pressed the states to force welfare recipients to work in exchange for their benefits, it can't be the one to hire them, according to the office of the general counsel of the Department of Health and Human Services.

That opinion is being challenged by other HHS officials. And the Office of Personnel Management and the General Accounting Office have been asked to rule on the matter.

The counsel's ruling was based on a provision of federal law which, in effect, forbids federal agencies from employing anyone without pay.

Under the "workfare" program pushed through by the Reagan administration two years ago, welfare clients can be required by the states to work off their benefits in jobs provided by state and local agencies and nonprofit groups. They normally receive no compensation beyond their welfare benefits.

If the counsel's opinion stands, the Social Security Administration, which administers federal welfare programs, and other federal agencies will be unable to provide slots for welfare beneficiaries unless Congress specifically approves, as HHS has requested.

HHS, according to sources, had wanted to provide slots at the SSA or similar offices, where welfare clients could help run day-care centers or provide other kinds of help.

One recent internal HHS memorandum, obtained by Jobs Watch, a public policy group connected with Catholic University Law School, directs SSA field officers to refrain from making any agreements with the states in which welfare recipients would work for them as part of a workfare program.

Because of legal questions, wrote Rose M. Lepore, SSA regional commissioner for the region covering the District, Maryland, Virginia, Delaware, West Virginia and Pennsylvania, "we will not be hosting workfare participants."

Sources said that the issue first arose last year when Linda S. McMahon, a strong advocate of workfare and then associate commissioner of SSA for family assistance, endorsed the concept of using workfare participants in the field offices. But the idea was challenged by the general counsel's office.