Despite persistent rumors here that the shah of Iran will return imminently to his Mexican home in exile, government officials said today that they doubt the shah will be back until Washington resolves its problems with the new Iranian government.

Officials here said the shah's medical status does not now appear to be the primary concern. Medical sources in New York said that the former monarch's condition was still serious but that radiation treatment for the cancerous condition in his neck was "within a day or two" of being completed.

The officials said they understood Mexico's readmission of the shah had been "a condition for giving him a U.S. visa" for medical treatment in the first place.

"His coming [back] here does not solve anything for Washington or for Tehran," a Foreign Ministry official said. "I don't see him coming here for some time."

There is little doubt that Mexico is prepared to receive the shah if and when he does come. Despite the tension and commotion his presence, and the subsequent seizure of the U.S. embassy in Tehran, have caused Washington, Mexico's government and people seem strangely indifferent to his presence.

Having closed its own embassy in Tehran two weeks ago, Mexico feels immune to the pressures of Iran. Mexico not only has its own oil wells and is not a member of the international oil cartel, OPEC, but traditionally has had little political interest or dealings with Iran or any other nation in the Middle East.

"We don't sell to Iran or buy their oil. We have no special economic tie," said a senior government official, "we no longer have an embassy. Frankly, if they want to break relations, we couldn't care less."

Mexico's readiness to defy the Khomeini government appears to stem not from any special sympathy for the shah or his past policies, but from a reaction to Iran's private and public threats against this country and its government.

Last April, when the first reports about the shah's possible arrival here began to circulate, the Khomeini government immediately announced it would regard Mexico's reception of the deposed monarch as a hostile act. An Iranian diplomat reportedly annoyed Mexican president Jose Lopez Portillo by telling him as much in a private visit.

Inevitably, there has been broad conjecture about Mexico's motives for letting the shah live here. The official explanation is that Mexico prides itself on its long tradition of granting asylum to persons of all creeds, ranging from the Russian revolutionary Leon Trotsky to anti-Castro Cubans and Latin American socialists.

Speculation that the cheif attraction for Mexico was the shah's immense wealth, fanned last week when an Iranian diplomat here charged the shah had invested "a lot of money" in Mexico, have been denied by usually well-informed businessmen.

Although former U.S. Secretary of State Henry Kissinger, as well as several of the shah's personal emissaries came here for talks with Mexican foreign Minister Santiago Roel, it was Lopez Portillo, irritated by threats from Tehran, who made the decision to let the shah in.

The few verbal protests from leftist groups which followed the shah's arrival June 10 lasted only a matter of days, after which he was largely ignored here.

Ironically the Mexican government and press, neither of which like to be seen kowtowing to the United States, have openly sided with Washington on the seizure of the embassy in Tehran. Both official and opposition newspapers have condemned the action in strongly worded editorials calling Khomeini's followers "fanatics and criminals."