Mexican and U.S. negotiators are nearing final agreement on a natural gas deal that, if completed in the next few days, could be the highlight of President Jose Lopez Portillo's visit to Washington next week, according to industry and government sources.

State Department officials are guardedly optimistic that a framework agreement on gas sales can be reached, but have not ruled out the possibility that the talks could again collapse.

In Congress, however, Senate Energy Committee chairman Henry M. Jackson (D-Wash.) said: "It is my understanding that we are near agreement and that we could have a deal soon."

State Department spokesman Hodding Carter told reporters yesterday that Deputy Secretary of State Warren Christopher left for Mexico with a team of negotiators to continue talks on energy and other issues. Carter also said it was possible a gas deal would not be announced until after President Lopez Portillo's visit.

A U.S.-Mexican gas deal ultimately could bring 300 million to 500 million cubic feet of natural gas to U.S. markets daily -- two-thirds less than Mexico and six U.S. gas companies originally agreed upon in August 1977.

Sources say the two sides are near agreement that the gas would be sold for $3.625 per thousand cubic feet to start with, and the major remaining issues to be settled are the rate of escalation of prices in future years and an understanding on whether Mexico's sale or U.S. purchases would be subject to interruption.

Senior administration officials say President Carter has ordered U.S. negotiators to press for final agreement on the gas sales, touching off a new flurry of activity in the State Department. His insistence is seen as reflecting the administration's concern over improving relations with Mexico, and an effort to minimize criticism of its handling of U.S.-Mexican issues.

In addition to energy talks, the United States also is engaged in bilateral discussion on Mexico's exports of winter vegetables -- largely tomatoes -- to this country, and on other trade issues.

The gas negotiations have been a source of controversy between Washington and Mexico since former Energy Secretary James R. Schlesinger quashed a proposed sale between Petroleos Mexicanos, the Mexican oil monopoly, and six U.S. pipeline companies led by Texas Eastern Transmission in December, 1977.

Last February, when Carter and Lopez Portillo met, the two pledged to continue technical talks on gas until their next meeting.

Energy Department and other administration officials have balked at Mexican demands that the price of gas be pegged to the price of heating oil, or a similar escalator. They argue that this would be an inducement to Canada, which now supplies about 4 percent of the U.S. demand, to raise its prices.

In recent months Ottawa announced it was increasing prices for gas from $2.16, to $2.80 per thousand cubic feet, and to as much as $3.30 next year.