General Accounting Office officials are expected to testify tomorrow that President Carter's use of government contracts to force compliance with his voluntary wage-price guidelines is illegal and likely to be ineffective.

Milton Socolar, GAO's general counsel, is reported as saying -- testimony prepared for delivery before a House subcommittee -- that, lacking approval from Congress, the president cannot withhold government contracts from businesses that do not go along with the wage-price program.

In addition, Jerome Stalarow, director of GAO's procurement division, is expected to criticize the program's enforcement provision as ineffective in view of the small size of the government's inflation monitoring staff and the small group of companies that will be affected.

"We have some serious doubts about the program," said one GAO source who asked not to be identified.

The opinion from GAO, a congressional watchdog agency, clashes with a Justice Department position that the Carter administration can deny government contracts to noncomplying firms. The White House relied on the Justice Department opinion is drafting the anti-inflation program last fall.

Administration officials, informed of GAO's planned testimony, said Friday they were confident the president's program is legal and will prove effective. They charged GAO officials with taking too narrow a view of the law.

"The GAO has to offer opinions that are very conservative by nature," said Lester Fettzig, administrator for federal procurement policies at the persident's Office of Management and Budget.

As part of his anti-inflation program, Carter has announced the government would deny contracts to companies that raise their prices or wages above voluntary guidelines set by the government. The guidelines call for holding increases in wages and fringe benefits to no more than 7 percent and keeping prices below the average increases for the past two years.

The enforcement provision takes effect Feb. 15. On that date, companies must certify they are in compliance with the wage-price standards in order to be eligible for federal contracts in excess of $5 million. The names of companies found by the government not to be adhering to the guidelines will be placed on a public list.

The squabbling over the legality of the compliance provision is likely to be settled eventually by the courts. One court challenge to the anti-inflation program -- a request for a preliminary injunction brought by the Association of Western Pulp and Paperworkers -- was rejected in December.

The suit raised objections to the legality of the program similar to those to be cited by GAO officials tomorrow, though the court never addressed these objections, deciding the case instead on other grounds. White House officials expect other test cases to follow.

The administration's position rests chiefly on the wording of the Federal Property Act of 1949 that gives the president power to prescribe government contracting policies on factors other than price alone. Justice Department attorneys have interpreted the act broadly to mean government conracting is primarily an executive branch function.

This power has been questioned in the past. The Johnson administration was taken to court over its policy of denying contracts to companies not in compliance with federal anti-discrimination standards. The judges ruled in favor of the White House.

But Carter's anti-inflation program is a murkier case, because it involves confusing guidelines and congressional ambivalence about the program.