Virginia's chief mine inspector yesterday received an order from Gov. Charles S. Robb to remove himself from an investigation of an explosion in a coal mine owned by a company in which the chief inspector holds stock.

The governor, under pressure from the United Mine Workers, rejected demands that Harry D. Childress be fired for what UMW president Richard Trumka called a "blatant conflict of interest."

The union, which backed Robb's 1981 campaign for governor, yesterday increased pressure on Childress, a former Clinchfield Coal Co. official who owns 1,162 shares in the Pittston Co. Pittston is Clinchfield's corporate parent and owns the southwest Virginia mine that was the site of a June 21 explosion in which seven miners died.

After disclosures of his stock ownership in The Washington Post, Childress said that he would sell the stock, valued at nearly $19,000, this week.

Trumka, in his first public comments about the matter, said yesterday that the sale was not enough to "remove a cloud hanging over Virginia's mine safety and health program."

"I viewed with utter amazement and a degree of sadness the political maneuvering which occurred in Richmond this week concerning Mr. Childress' blatant conflict of interest," said Trumka. "We have afforded Gov. Robb more than enough time to take appropriate action. His failure to do so leaves me no recourse but to demand Mr. Childress' immediate dismissal."

Trumka said in an interview that he had called Robb twice urging that, at least, Childress be stripped of his duties as chief of the McClure investigation. During the first call Tuesday, Robb told him of Childress' decision to sell the stock, Trumka said.

"We've had 35 mine fatalities in the country this year and 11 of them have been in Virginia, although Virginia only mines 5 percent of the coal," said Trumka. "That indicates the state and federal officials have failed to do their job."

Robb said in a statement yesterday that he has been "fully satisfied" with Childress' performance, and that Childress had closed more mines in the first six months of this year than in all of 1982. Among those are six mines whose mineral rights are owned by Pittston and leased to independent contractors, the governor said.