The Library of Congress' Congressional Research Service has declared that President Reagan's well publicized order giving the Office of Management and Budget final say on federal rules and regulations may be illegal.

The opinion, which has no force of law, nonetheless provides a careful piece of legal research for the congressman who decides to challenge OMB's right of review.

The document in question is Executive Order 12291, signed by President Reagan Feb. 17. Among other things, it requires a cost-benefit analysis for "major" rules and reconsideration of existing and pending rules. It permits the OMB director to supervise many aspects of rulemaking previously left to the regulatory agencies.

Executive Order 12291 was accompanied by an opinion from the Department of Justice which concluded, not surprisingly, that "the order is acceptable as to form and legality."

The Congressional Research Service opinion, written by Morton Rosenberg, said there are three basic problems with 12291, and each could result in a rule being overturned by a court. The alleged problems:

Executive Order 12291 conflicts with the Administrative Procedures Act, the law governing rulemaking, because it sets up a central rulemaking authority while the act focuses authority on individual regulatory agencies.

The discretionary authority of the regulators, which Congress delegates to them by title, "may be totally displaced" because of OMB's intervention.

The creation of a centralized authority for rulemaking also creates a "critical access point" for interested parties to attempt to influence rules and regulations. "A court might rule," Rosenberg wrote, " . . . that the order's failure to protect the integrity of the policymaking process in the interest of the public from such influences . . . deprives interested persons of their due process rights . . . and the possibility of effective judicial review."

C. Boyden Gray, counsel to the Presidential Task Force on Regulatory Relief, said in an interview that he could not respond "any better than it was said" in the Justice Department opinion. "What we're doing is not all that radical or new," he said, adding that a recent court opinion (Sierra Club v. Costle ) suggests "that the president not only has the right but the duty to discuss policy matters with the heads of the departments."