Government regulators have asked Congress for legislation that would allow a controversial meat preservative to remain on the market for at least three more years, even though a study shows it causes cancer in test animals.

The preservative, sodium nitrite, is used in processed meats, primarily hotdogs, bacon and other pork products, to provide color and flavor and to prevent the formation of botulism toxins, a deadly poison.

A study last year by Dr. Stephen Tannenbaum at Massachusetts Institute of Technology concluded the sodium nitrite causes cancer in rats. On that basis, the Agriculture Department and the Food and Drug Administration had negotiated with the industry a phase-out over a period of time.

But the Justice Department yesterday concluded that if Tannenbaum's results are conclusive, existng food laws require an immediate ban.

The Agriculture Department and FDA said that such a ban would be too disruptive of the pork industry and would create a serious public health threat because, the agencies say, there is no adequate substitute for nitrites.

Healt, Education and Welfare Secretary Joseph A. Califano Jr., at a joint press conference yesterday with Agriculture Secretary Bob Bergland, said the legislation would "assure adequate time to review the scientific evidence" in the MIT study and would allow a phase-out "as soon as safe and feasible alternatives are available."

Califano defended the action, saying, "Nitrites pose a unique and difficult paradox in our quest for food safety: They . . . protect the public health in one critical aspect and yet threaten it in another."

The legislation seeks to amend the food safety laws-in the special case of nitrite only-including the controversial Delaney Amendment, which forbids the use of any substance in food which causes cancer in man or animal when ingested.

The legislation they are proposing would allow the continued use of nitrite for one year and calls for its phase-out over an unspecified period of time, though both Califano and Bergland said they hoped the phase-out would be complete by 1982.

Consumer groups, which have been seeking a ban on the preservative for several years, oppose the legislation. Ellen Haas, a director of Community Nutrition Institute, a public advocacy group, called the action "unconscionable."

Haas criticized the proposal as a "purely political, nonscientific and concessionary move." She said the Administrative Procedures Act would allow for a full hearing "without imposing unspecific time delays."

But Richard Lying, president of the American Meat Institute, a trade association, said if the government's action has "the affect of calming everyone down . . . we applaud it."

In what one senior Agriculture official described as an effort to balance pork producers' interests with those of consumers, the legislation has been referred to two committees in each house: the Senate and House Agriculture committees: the subcommittee on health and science, chaired by Sen. Edward M. Kennedy (D-Mass.), and Rep. Henry Waxman's (D-Calif.) subcommittee on health and environment. The latter two committees are considered more consumer-oriented than Agriculture.

Without this legislation, officials at Agricultural and FDA say privately, Congress is likely to ban any kind of regulatory action against nitrites, just as it did when FDA attempted to ban saccharin in 1977.

At the press conference, Bergland said the hog producers, who would be most adversely affected by a ban, "agree this seems to be a reasonable alternative. They are not ecstatic about it," he said, but "hog producers need to have the question settled."