John A. Gavin, U.S. ambassador to Mexico, yesterday denied that he endorsed Sen. Jesse Helms (R-N.C.) for reelection. Helms aides said they placed Gavin's name on the endorsement list because of a birthday telegram from Gavin.

"I have not given, nor will I give, any candidate authority to use my name for political purposes while I hold this office," Gavin said in a statement issued through the Mexico City embassy.

Gavin's name appeared on a list of 22 U.S. ambassadors who, according to the Helms campaign, had endorsed Helms in his tough battle with Democratic Gov. James B. Hunt.

Helms is chairman of the Western Hemisphere subcommittee of the Senate Foreign Relations Committee. The committee has jurisdiction over nominations of ambassadors.

The endorsements, announced at a Raleigh news conference Thursday, drew sharp criticism from some former ambassadors and from the principal association of career Foreign Service officers.

A Gavin aide telephoned Washington Post special correspondent William A. Orme Jr. in Mexico City yesterday to say that the ambassador never gave permission for his name to be used.

In a statement, Gavin said his "support for President Reagan's election effort is obvious, but I haven't indicated any personal preference for any other candidate."

Gavin, appointed by Reagan in 1981, said that White House and State Department guidelines prohibit U.S. envoys from active involvement in "partisan politics."

In Raleigh, Helms' media coordinator, Michael Harrell, said, "Ambassador Gavin did send Sen. Helms a birthday greeting in which he expressed his support for the senator along with the birthday greeting. The ambassador's support for Sen. Helms is clear. Whether or not he wants his name to be used publicly is another matter."

Helms turned 63 on Oct. 18, and Harrell said Helms received a birthday telegram from Gavin.

"In that telegram he said 'best wishes and continued success.' Whether it turns out that he officially is on a list of these individual endorsements, we're sure and confident of the ambassador's personal support for the senator," Harrell said.

Hunt's press secretary, Will Marshall, said, "These ambassadors were trotted out to prove that Sen. Helms is not on the fringe of foreign policy. Evidently Sen. Helms' staff was not very careful, if they took a courtesy birthday greeting to mean an official endorsement."

Helms' aides have said the endorsements by the ambassadors were meant to show that Helms is in accord with Reagan administration policy.

The ambassadors on Helms' list are Reagan-appointed conservatives. They are not career diplomats, so they are not covered by laws restricting partisan political activity by federal workers.

Gavin, whose mother is a native of Mexico, is a former actor and a friend of the president. Before his appointment, he was best known in Mexico as the star of a glamorous rum commercial.

Gavin been criticized in Mexico for meeting with elected officials of the right-wing National Action opposition party. Several leftist opposition parties have accused him of meddling in internal politics and are demanding his ouster.