Long before oil brought Mexicans much wealth or power, it was a source of fierce pride. They learned to call petroleum their "patrimony," a valued bequest of the expropriation of foreign oil companies' holdings in 1938 for what they considered an often victimized fatherland.

Then the discovery of vast reserves in the 1970s and soaring world prices raised hopes for development in a country weighted down by relentless population growth.

Now as the threat looms of a major drop in oil prices, the effect on the public's confidence of watching the worth of this patrimony rapidly eaten away has raised almost as much concern among economists and politicians as the fairly predictable financial impact.

"Everything depends on the expectations of the people," a conservative young Mexican economist told an American reporter. "If there's confidence, we can come out all right. But if this gets worse, you're going to have to put marines along the border to stop all the people giving up on this country."

"Do you think Mexico will be communist? We're very afraid," said a wholesale clothes merchant whose family is entering this capital's middle class.

Villains and scapegoats are being sought. Much press attention has been directed at allegations that ex-president Jose Lopez Portillo and his family have accumulated ostentatious wealth, although the current administration has ruled out prosecution.

The current situation is all the more difficult for Mexico because of an initial reluctance even to recognize the first relatively small drops in the market value of its petroleum more than 20 months ago.

Because spending cutbacks made to compensate for that loss were inadequate, the economy already was weakened. The budget already is cut back as Mexico faces a foreign debt of more than $80 billion.

Yet a new president, who works hard to project the image of cool economic competence, along with some extra help from international creditors may give Mexicans the reserve of confidence they need.

"Even if oil prices were to stay the same, it's obviously a dicey situation," said one economic analyst. But there is room to move, he cautions. "Mexico won't go down the tubes."

Mexican energy officials and diplomats, often working closely with their Venezuelan counterparts, have been shuttling among other oil producers to try to limit the damage. Announcements of Mexico's new oil prices have been indefinitely postponed in the hope an agreement can be reached with other producers.

Many economists here believe that a drop of $2 to $4 in OPEC's trend-setting oil price, currently $34 per barrel, could be sustained here without major problems. Beyond that range, the arithmetic gets alarming for Mexico. Abstract questions about confidence and social cohesion take on more importance.

Petroleum exports were originally expected to bring Mexico about $15 billion this year--70 percent of anticipated total foreign exchange earnings.

The Finance Ministry estimates that for every dollar that oil prices drop, Mexico will lose $500 million over the course of 12 months. The ministry expects some of this lost income to be offset by declining interest rates. According to General Director of Credit Jose Angel Gurria, Mexico will save $700 million a year for every point taken off the interest it owes foreign lenders.

But once the $4 line is passed and Mexico's petroleum income is reduced by more than $2 billion a year, few economists expect that interest rates will drop enough to make up the difference.

Private-sector economists estimate that a drop of more than $2 would leave Mexico without enough foreign-exchange income to cover the already reduced level of imports.

The technical capacity and reserves exist to increase oil exports by several hundred thousand barrels a day to help make up the difference. But as a spokesman for Pemex said, "Mexico can't take that decision so easily. If Mexico attempts to increase exports, that increases the disorder in the market. To do that, we would have to consult with other producers."

In the short run, the question is how much more money Mexico can borrow so that large numbers of industries can avoid shutting down for lack of vital imports. Mexico is counting on American and other major international creditors, and the government appears encouraged by the response.

U.S. Ambassador John Gavin has said "it is necessary to cooperate with Mexico" and "what is bad for the Mexicans is bad for us." In Washington, President Reagan's chief economic adviser Martin Feldstein has said that if falling oil prices threaten Mexico's finances, the rest of the world will have to help. Other administration officials agree.

Also reassuring was the recent news that an international group of more than 500 financial institutions has firmed up a loan of $5 billion. The major participants recognize privately that they will probably have to come up with more money later this year to help carry Mexico through. The country may need "$1 billion, $2 billion, $3 billion more," one banker commented this week. Bankers certainly do not want to come up with this much more money, but most believe that a deal can be worked out if the U.S. and other governments help.

The 3 1/2-month-old administration of President Miguel de la Madrid is working to avoid the abrupt shifts, first ignoring, then overreacting, to the drop in crude prices that characterized the previous government.

The most immediate fear and expectation on the streets is of another currency devaluation. People who have watched the free-market value of their 100-peso bill drop from about $4 to 60 cents in one year are no longer asking whether there will be another decline but when and how much. Banks have very limited supplies of dollars to sell at any price and some are already reported charging higher rates than the official "free exchange" dictated by the government.

"The devaluation doesn't have to be of great magnitude," said one private economist. "But that really will depend on the expectations of the people. The people in this country, the minute they see problems. . . , want to buy dollars."

In a nation where even peasants tend to think of their money in terms of its dollar value, devaluation and inflation fuel each other with particular intensity. But as prices are rising by more than 100 percent a year, wages still lag far behind.

The powerful leader of the Mexican Workers' Confederation, Fidel Velazquez, has warned that current policies put the Mexican workers "up against the wall" and are "contrary to all principles of justice and fairness." Velazquez estimates that the purchasing power of the average Mexican has declined by 68 percent since January of last year.

But the government, as part of the austerity program worked out with the International Monetary Fund, is committed to reducing or eliminating many of the costly subsidies that were once underwritten by oil revenues. Mexican workers are caught in the squeeze, and current price ceilings, Velazquez said, "are only theoretical."

Social pressures are certain to mount along with the economic ones. But Mexico's political system remains remarkably flexible.

The sophisticated domination of the Institutionalized Revolutionary Party has not yet shown any signs of faltering.