The D.C. Police Department is investigating allegations that two District police officers forcibly obtained statements from witnesses who had information about the killing of a Capitol Hill man and then threatened them with a perjury charge if they changed their stories when they testified before a grand jury.

D.C. Superior Court Chief Judge H. Carl Moultrie I ordered the investigation on Tuesday, just before the scheduled murder trial of Gregory Benson, who is charged with the Christmas week of 1979 shooting of Frank Flook. Benson's first murder trial last October ended in a mistrial when a jury was unable to reach a verdict.

The judge ordered the police investigation after Timothy D. Junkin, Benson's defense lawyer, alleged that one of the government witnesses in the case, Curtis Elmore, had been taken into police custody for about nine hours. Junkin said Elmore was never arrested, but was handcuffed to a table and "beaten and abused" until he stated that he had seen Benson near the scene it occurred. Another government witness, Stanley McCrae, allegedly was threatened by police with "hanging," the lawyer told Moultrie.

"The rack and torture chamber should not be substituted for the witness stand," Junkin said yesterday in asking Moultrie to dismiss the murder charge against Benson because of the alleged police misconduct. Moultrie refused, but ordered the police department's internal affairs unit to investigate the actions of homicide detectives Dwight K. Vasey and Charles Shuler.

Inspector Horatius Wilson, head of the internal affairs division, declined to comment yesterday on the allegations, saying the probe was "continuing" and that further comment might "prove prejudicial to the case."

Assistant U.S. Attorney Reggie B. Walton, the government prosecutor in the case, disputed Junkin's contention that the police had improperly obtained the statements from the witnesses. He argued that there was no corroboration of the allegations and that they should be given little credence since they were made by friends of Benson's who had previously given damaging testimony against him and now seeking to change their stories.

At Benson's first trial, he was identified by Flook's wife as one of two men who stood outside her front door just before her husband was slain on Dec. 27, 1979. Benson has denied that he was involved in the slaying.

Moultrie postponed the start of Benson's new trial until early next month, pending resolution of Junkin's allegations.

Junkin said that Elmore and McCrae were pressured by police to say they had seen Benson in the vicinity of the shooting. Elmore testified this week that he was asked the same questions by police more than 100 times, and each time they were not satisfied with his answers.

Finally, Elmore's mother, who he said had accompanied him to the police station, pleaded with him to cooperate and that then he changed his story to satisfy police, Elmore told Moultrie in courtroom testimony and in an affidavit he submitted to the court.

According to testimony by Elmore and McCrae, police later threatened them with perjury if they changed their stories when they went before a Superior Court grand jury investigating the slaying before Benson was indicted.

Vasey, 40, an 11-year veteran of the force, testified in court that he did not remember details of police questioning of Elmore and McCrae. Shuler, who has left the D.C. police force since the investigation, denied that any witnesses were handcuffed or abused.