Ousted Montgomery County Police Chief Robert J. DiGrazia lost the first round of his bid to contest his dismissal yesterday when a County Circuit Court judge refused to grant him an appeals hearing.

DiGrazia was fired last December by County Executive Charles W. Gilchrist, who said that diGrazia's strained relationship with the county's 750 officers had rendered the ex-chief ineffective in leading the department.

DiGrazia maintained that Gilchrist's decision amounted to a punitive action and that he had the right to an appeals hearing before a police board under the provisions of the "law enforcement officer's bill of rights."

In making his ruling, Judge Philip M. Fairbanks concurred with the county's argument that diGrazia was a nonmerit employe who served at the pleasure of the county executive.

DiGrazia's removal, the judge worte, "was neither disciplinary, punitive nor discriminatory, but merely a lawful exercise of the prerogative of the county executive."

DiGrazia was out of town yesterday and could not be reached for comment. His attorney, Peter Davis, said he did not know if diGrazia would seek an appeal.

Gilchrist said yesterday that he was "very pleased" with the judge's decision, but declined further comment on diGrazia's legal challenges. The former chief also has sued the county in federal court for $6.5 million, contending his future employment prospects are "diminished" by his dismissal.

Gilchrist said that he still intends to find a permanent successor to diGrazia by early June, six months after his firing, but at this point is only receiving rather than soliciting applications.

Yesterday's ruling, Gilchrist said, had no effect on the search because he said he was always confident that the court would decide in his favor.

Gilchrist declined to say whether he may make permanent the appointment of Acting Chief Donald E. Brooks, whom diGrazia once tried to fire.

Since diGrazia's ouster last Dec. 7, Gilchrist has several times expressed his pleasure with Brooks' quiet handling of the department.

But it is unclear whether Gilchrist believes that Brooks, a 28-year veteran of the force, fits his concept of a chief who will continue diGrazia's insistence on training officers to be "social workers with guns" without displaying diGrazia's controversial flamboyancy.

Gilchrist's office said yesterday that 30 candidates have applied for the chief's job.

Gilchrist also appears to have abandoned his intention to create a new post of county public safety director who would supervise police, fire and rescue services. At the same time, discussion of Maurice Cullinane, a former D.C. police chief, as a candidate for the new post has ended, sources said yesterday.

DiGrazia's dismissal came after a tumultuous 25-month term in which the ex-chief found himself frequently at odds with his men over his policy changes in the department.

His administration stressed community relations, more extensive and sophisticated training for the officers and the use of civilians and outside consultants to aid in police policy making.

His term was also marred by a grand jury investigation into allegations, made by a citizens' group, that he had managed the department. But last week the grand jury cleared diGrazia of any wrongdoing.

DiGrazia's $52,811 annual salary, which he has continued to receive since his firing, will be stopped March 1.