Leaders of a national coalition of farm-worker organizations said yesterday they oppose President Carter's upcoming visit to Mexico because it may result in an increased use of temporary foreign labor in the United States.

"We are apprehensive about the upcoming meeting between President Carter and President Jose Lopez Portillo of Mexico because it may result in a trade-off of Mexican oil for the expansion of immigration under the H-2 PROGRAM, WHICH UNDERMINES THE RIGHTS AND PROTECTIONS OF @U.S. and foreign agricultural workers alike," leaders of the National Association of Farmworker Organzations said in a joint press statement yesterday.

The NAFO officials spoke at the beginning of their fifth annual conference, being held here at the International Inn.

While not specifically joining the opposition to Carter's planned Mexican trip, Cesar Chavez, president of the United Farm Workers of America, said he also had serious misgivings about the H-2 program.

Chavez, who gav e the conference's keynote address last night, said the H-2 program is "knocking hundreds of Puerto Ricans out of jobs across the country, and is threatening the jobs of other farm workers on the West Coast." He urged the conference participants to unuonize to protect jubs.

Washington Mayor Marion Barry joined the farm union leader in calling for "worker solidarity."

Recalling his childhood labors as a Mississippi farmhand, Barry told the applauding crowd: "I don't come here abstractly talking about my relationship with you. I come here out of experience. Therefore I think it important to tell you that I believe black workers, while workers and red workers should unite with each other to bring about change in this country."

Under the H-2 program, administered by the Immigration and Naturalization Service, temporary foreign laborers are allowed to enter the United States for mostly menial jobs when "unemployed persons capable of performing such service or labor cannot be found in this country."

Already, according to NAFO, an estimated 4,775 foreign workers have been certified under the H-2 program for this season's apple harvest on the East Coast. The effect is to take jobs from native migrant workers and to undermine union organizing among migrant farmers in the United States, the NAFO leaders said.

President Carter is scheduled to visit Nexico City Feb. 14-16. Ostensibly, the trip is to return a courtesy to President Lopez Portillo, who visited the United States a few months after Carter's inauguration.

However, the recent discovery of vast oil reserves in Mexico, coupled with that country's need to reduce a huge -- in excess of 40 percent -- unemployment rate, has given the trip new significance in the minds of many political observers.

Leaders of the largely Hispanic NAFO conceded that their opposition to the Carter trip, and particularly to the H-2 program, presects them with a dilemma by putting them in the position of barring other Hispanic workers.

"But we're not trying to keep people out. We just want the immigrants to come into the country under legal resident status. Under the H-2 program, employers bring in temporary workers, mostly men, and exploit them. We want that to stop," said Lalo Delgado, a NAFO representative from Wheatridge, Colo.