The Department of Health, Education and Welfare yesterday opened a national campaign to urge patients to get a second doctor's opinion before surgery.

HEW Secretary Joseph A. Califano Jr. said the program should help reduce the "tremendous amount" of unnecessary operations performed, and thus overall medical expenditure.

The effort is aimed particularly at beneficiaries of Medicaid and Medicare, the federal health care programs for the poor and elderly. Although HEW last year removed legal barriers to government funding of second-opinion visits, it has not previously encouraged voluntary use of the payments.

The total amount of unnecessary surgery in the United States is unknown. HEW's health care financing administrator, Robert A. Derzon, said there is "too much conflicting evidence" on the subject for HEW to be sure.

He said the best estimate was produced in 1975 by the House oversight and investigations subcommittee under Rep. John E. MOss (D-Calif.). Moss estimated that about 17 percent of operations in 1974 were unnecessary, or 2.38 million procedures at a cost of $3.92 billion.

HEW is troubled, however, by the "significant variations" in the rate of surgery around the United States, Derzon said. Studies have shown that up to 39 percent of hysterectomies performed are not needed, that the rate of surgery has grown four times as fast as the population, and that five out of 1,000 discretionary operations are fatal.

In addition, Derzon said, the rate of operations varies greatly within states and among regions. The overall rate is 31 percent higher in the South than in the midwest, for example.

Medicare pays 80 percent of the second-opinion fee and Medicaid the full amount in states that have approved it, Derzon said. The programs will also cover a third opinion if patients desire.

HEW has spent $155,000 in the last few months to set up its publicity campaign, including radio and television announcements, a national toll-free hotline - (800) 325-6400 - for referrals, and distribution of 5 million brochures.

The program was also tested this summer along 1.5 million Medicare beneficiaries in New York and 350,000 in Detroit, Derzon said. Out of 564 requests for second opinions, 268 patients got them, and six requested a third examination. Derzon said the second opinion differed in 79 cases from the first, but he did not know how many patients had the recommended operations.

The two-city experiment, expected to last three years and cost 1 million waives the usual patient's share of second-consultation fees, Derzon said, explaining that "demonstrations requiring waivers always create inequities."

HEW will watch closely to prevent abuses in the program, such as second consultation doctors recommending surgery to collect the fee, Derzon said. Most patients return to the first physician if they decide to have the operation, a matter of courtesy that curtails potential abuses, he said.

The program should help improve general quality of health care and lower costs, although it probably will not help track unnecessary surgery, he added. "We may never be able to get a finely tuned numbers on that."