The Navy, under mounting criticism for dismissing three top officers whose air base paid a defense contractor $659 apiece for aircraft ashtrays, acknowledged yesterday that a Navy workshop is selling the base the same ashtray for about $900 each.

Meanwhile, the wing commander and base commander of Miramar Naval Air Station near San Diego, who were relieved of duty Thursday, complained of unfair treatment, saying they assumed their posts long after the controversial purchases and were summarily discharged without due process.

Navy Secretary John F. Lehman Jr. defended his disciplinary actions on grounds that he had lost confidence in the officers because of the overpricing. But he said he will reinstate them if they are exonerated in an investigation.

Defense Secretary Caspar W. Weinberger announced the dismissals Thursday as evidence of the Pentagon's "very firm action" against contractor overpricing, which he said was brought home by Miramar's contract with Grumman Aerospace Corp. to produce the ashtrays for E2C electronic warfare planes.

Navy officials said yesterday, however, that the Naval Air Rework Facility near Miramar in San Diego tried to manufacture the same ashtray and, using Grumman designs, wound up charging Miramar about $240 more for each.

Miramar has been purchasing the ashtrays from the Navy workshop and Grumman since the 1970s, officials said.

Critics in the Navy seized on higher prices paid by Miramar to the workshop as further evidence of inequitable treatment in which the dismissed officers were made scapegoats to demonstrate toughness on contractor abuse.

"No one was fired for buying $900 ashtrays," said one naval officer who asked to remain unnamed.

Rear Adm. Thomas J. Cassidy Jr., relieved as Miramar wing commander, said he assumed his post there in August 1983, more than two years after the first problem purchase cited Thursday by Weinberger in announcing the dismissals.

"I'm absolutely flabbergasted and totally dismayed with the system," said Cassidy, 52, a 33-year Navy veteran who is among the few admirals relieved of duty because of contracting problems. "I was working and living in Washington, D.C., when the alleged improprieties occurred," he said by telephone from San Diego.

As wing commander, Cassidy supervised 28 Pacific Fleet squadrons and the Miramar base. He said he had no direct responsibility for procurement. Cassidy said he was first apprised of the high-priced ashtrays 10 days ago and immediately ordered a supply officer to investigate whether the costs were reasonable.

Capt. Gary E. Hakanson, 47, relieved as base commander, said he assumed his post in April 1983 and also first heard about the ashtrays in the last two weeks. The next word about them came in his dismissal notice, he said.

"It's unfair," he said in a telephone interview. "We were relieved without some form of due process for something that happened when we weren't even here."

Both men had previously announced plans to retire, Hakanson Aug. 1 and Cassidy Sept. 1.

Cmdr. Jerry Fronabarger, relieved as supply officer, could not be reached yesterday. He assumed his post in July 1982. A spokesman for Lehman said the secretary can relieve officers "anytime he loses confidence in them. The primary problem in this case was the unreasonableness of spare parts prices."

The three officers can be reinstated if an investigation finds them innocent, the spokesman said.

But retired vice admiral William St. George, a former Pacific Fleet commander now practicing law in San Diego, said, "Careerwise, they've already been hung. Now the Navy is ordering an investigation to see if the hanging was correct or not. It is grossly wrong."