Senators who backed the Panama Canal treaties last year despite criticism at home sought yesterday to capitalize on Panama's acceptance of the deposed shah of Iran, declaring that it vindicates their position.

But opponents of the treaties said they still consider them dangerous agreements and they don't like Panamanian strongman Omar Torrijos today one ounce more than they did before.

One treaty backer, Frank Church (D-Idaho), chairman of the Senate Foreign Relations Committee, is fighting a hard battle for re-election in a state where the treaties are very unpopular.

Church said yesterday, "This is the first great friendship dividend to flow from the Panama Canal Treaty.

"It demonstrates, once again, that to deal justly with others, even the smallest of countries, is the best policy for the u.S.

"Despite our predicament, Mexico slammed its doors shut on the return of the airing shah. But Panama, reacting to our need, threw open its doors and welcomed him in."

Sen. Russell B. Long (D-La.) who also voted for the treaty, said Panama's acceptance of the shah "confirms the good judgment of some of un in voting for that Panama treaty."

Other treaty backers, among them Jocob K. Javits (R-N.Y.) and Majority Leader Robert C. Byrd (D-W. Ca.), expressed satisfaction at Panama's action.

There are actually two treaties, one turning the Canal over to Panama and the other guaranteeing its neutraltiy, but they are referred to collectively as "the treaty."

Byrd called it a welcome development and said he hopes it paves the way for the release of te U.S. hostages in Tehran. Several senators said that had the United States not approved the treaty turning the canal over to Panama, Panama wouldn't have allowed the shah in.

Sen. Edward M. Kennedy (D-Mass.), campaigning for the presidency in St. Louis, said he hoped the action would mean "a new opportunity for the safe release of the hostages."

But conservative senators who opposed the treaty last year said they still don't like it.

sen. John Tower (R-Tex.) said, "I don't think any better of the treaty than I did before. This doesn't obviate the flaws of the treaty."

Tower added that he guessed "there probably were other offers" to take the shah.

Sens. Pete Domenici (R-N.M.) and James McClure (R-Idaho) gave ringing "No" answers when asked if they now think better of Torrijos.

"It doesn't change my feeling about the treaty at all," said Domenici, who said the stability of the country is still a concern to him. "The risks to the canal -- terrorism and the like -- are still there."

McClure said he still thinks the treaty is bad for the United States, but added that Torrijos' status in the eyes of some Americans probably will rise. He said he can understand why some politicians hurt by their pro-treaty vote are trying to use the latest developments to justify that vote. p

Sen. Jesse Helms (R-N.C. said Panama's acceptance of the shah "doesn't change my opinion at all" that the treaty was "a tragedy."

"I'm sure that (Panama) was not the shah's first choice," he said.

S. I. Hayakawa (R-Calif.), asked if he believed the shah's removal to Panama vindicated his vote for the treaty, joked, "I did it because I knew we'd need them some day."

In California, a spokesman for former governor Ronald Reagan, who had opposed the canal pact and had referred to Torrijos last year as a "tin-horn dictator," said, "As Gov. Reagan has stated publicly many times, the shah's decision on whether to stay or leave the country should be his. . . . If he feels that's where he can have safe haven, that is what should prevail and the governor's opinion of Omar Torrijos has nothing to do with it."

In San Antonio, where the shah's stay at Lackland Air Force Base had caused tension and threats of violence, officials were quoted by the Associated Press as being relieved at his departure. "It is quite a relief from the tensions," said Mayor Lila Cockrell.