Mexico's abrupt refusal to permit Shah Mohammad Reza Pahlavi's return to exile here appears motivated by its unwillingness to be drawn deeply into a conflict that poses immediate security threats at home and could lead it into a long-term broader confrontation with the Islamic and Arab world.

While Mexico seemed invulnerable to Iranian pressure -- it closed its Tehran embassy three weeks ago and has vast oil and natural gas supplies -- high officials here talked privately about the danger of Iranian or Moslem attacks on Mexico's European embassies. they drew a parallel with the recent destruction of the U.S. embassy in Pakistan.

The point of the serious security problem was further driven home to the government two days ago by a State Department request for additional security, not only for the U.S. Embassy in Mexico City but for a string of consulates along the U.S.-Mexican border. The U.S. sources pointed out that some 1,500 Iranian students live just north of the Mexican border in San Diego. The mexican government is aware it would not be difficult for those students to cross into Mexico, the sources said.

While it does not appear to be a major factor in President Jose Lopez Portillo's anti-shah decision, government officials here have evidently resented the intervention of former Secretary of State Henry Kissinger on behalf of the shah here and Kissinger's "public boasting," as a government official put it, about the fact that he "arranged for the shah to come to Mexico."

In a recent interview a key Cabinet member said, "The fact of the matter is, the decision to receive the shah in Mexico had already been made when Kissinger started interfering. That was too bad. It made it look like we were catering to Kissinger. This was caused a very bad impression here."

Officials at the U.S. embassy here said they were completely taken by surprise when they received a phone call from an under secretary of foreign affairs just one hour before the foreign minister announced Mexico's sudden refusal to receive the shah.

According to qualified sources the decision was made by Lopez Portillo some six hours earlier in a Thursday morning meeting with the foreign minister.

The shah's family and representatives in New York were reportedly informed before the U.S. government.

One Cabinet member, summing up views commonly heard today, said, "Why should we get involved in what is now the most important world crisis and why should we look for trouble with the Middle East?" He added, "Even the Americans have not pressed us to take the shah. I think it would be a great mistake."