The White House has started an "accelerated search" for a permanent head of the National Aeronautics and Space Administration to replace indicted Administrator James M. Beggs, officials said yesterday, amid concern at the White House and in Congress about who is in charge at the agency in the wake of the explosion Jan. 28 of the space shuttle Challenger.

White House officials say they were taken aback to learn after last week's disaster that Beggs, though officially on indefinite leave, was still actively working at NASA following his indictment in December on fraud charges unrelated to the agency.

After he was indicted, Beggs was given a choice of resigning or taking an unpaid leave of absence and chose the latter, the officials said. He was given a deadline of three weeks to depart.

"No one here knew" that Beggs was still occupying an office at NASA headquarters until after the accident, said one senior administration official, who asked not to be identified.

"We all got very exercised," he said. It was at this point, he added, that senior White House officials decided to begin a search for a permanent administrator, realizing that Beggs would have to resign, with some officials expressing regret that they had not asked him to resign in the first place.

High-ranking administration officials said that President Reagan was not pressuring Beggs to leave. They said that Beggs was among those who recognized the need for a permanent administrator and that despite his early reluctance, he has recently indicated that he was willing to resign.

As to a permanent replacement, acting administrator William R. Graham "has done a very good job" following the accident, White House officials said. He will remain in charge for some time and will be a candidate for the permanent job, they added.

However, one presidential assistant said Graham probably would not be chosen because of his limited experience at NASA and would be expected to return to his former post as deputy administrator to the new chief.

Beggs, widely regarded as the most politically astute NASA administrator in two decades, holds the support of many in NASA and on Capitol Hill.

If White House officials were surprised at Beggs' continuing role, members of Congress apparently were well aware of it. "It was certainly our understanding Beggs was to be available as a resource to help with the transition . . . getting the budget submission ready," said an aide to Sen. Jake Garn (R-Utah), chairman of the Senate Appropriations subcommittee that oversees NASA. Garn made a space shuttle flight last year.

"I don't think Beggs would try to go in and operate things . . . . He's well aware of his status. There was no question in our minds" that Graham was running the agency, the aide said.

Garn's office has had no official or unofficial word from the White House about its plans to replace Beggs, the aide said. Until it does, Garn will offer no candidates for the job, he said.

Graham is ensconced in the same office complex with Beggs at agency headquarters at the foot of Capitol Hill. A NASA neophyte with just over two months at the agency, he had been pushed for the No. 2 job there by the conservative Heritage Foundation, according to sources, but has not yet built much of a base of support in NASA or in Congress.

Much congressional concern was allayed initially when Beggs, with White House approval, named NASA veteran Philip E. Culbertson, formerly associate administrator, as general manager. That effectively bypassed Graham in day-to-day operations and firmly imprinted Beggs' stamp on the transition.

According to one administration official, Graham has expressed dismay about the situation since the shuttle accident and questioned how far his authority really extends with Beggs still on the scene.

But in the wake of the tragedy, which destroyed Challenger and killed its seven crew members, Graham has appeared on numerous television news programs as NASA's official authority figure.

White House officials said they were pleased with Graham's "calm" public demeanor as he tried to explain possible causes of the accident to a distraught public. "We don't want to do anything to pull the rug out from under him," an official said.

Persistent reports from those close to the agency's operations charge that Graham was forced on the agency by the White House over Beggs' vigorous objections and that personal relations between the two have always been, at best, cool. One NASA source says they barely speak to each other.

Beggs is said to have felt Graham lacked the experience to run such a complex agency.

Neither Beggs nor Graham was available for comment.

Some NASA employes, particularly at headquarters here, have divided into camps of support for one or the other, sources said.

For almost six months beginning last spring, Beggs vigorously resisted hiring Graham, 48, according to the reports. But last November, the White House finally forced Beggs to accept Graham as deputy administrator.

The Senate's main concern in approving Graham was a fear expressed by some NASA employes that he might militarize the agency.

On Dec. 2, six working days after Graham assumed his duties, the Justice Department indicted Beggs. He was charged with trying to hide cost overruns on a federal defense contract between 1978 and 1981 while he was an executive vice president at General Dynamics Corp.

Denying "wrongdoing of any kind" and expressing confidence that he would be exonerated, Beggs refused to resign. "I do not intend to leave the agency," he said as he announced he was taking an indefinite leave of absence. "This is not an interim step to a resignation."

There have been continuing suspicions voiced, among NASA employes in Houston and other centers as well as in Washington, about the manner in which Graham came to head the agency.

But the office of Attorney General Edwin Meese III dismissed as "nonsense" recurrent suggestions that, as a former key White House adviser, he had played some role in pushing Graham in order to have him replace Beggs after the indictment. Other White House sources concur.

Graham had never worked at NASA or for any of its contractors. He has a bachelor's degree in physics and advanced degrees in electrical engineering; his experience included stints with Hughes Aircraft Corp., at the Air Force weapons laboratory in New Mexico in the early 1960s, as a planning analyst at the Rand Corp. in California beginning in 1965, and for the last three years, as chairman of the White House Advisory Commission on Arms Control and Disarmament. A former colleague at Rand said Graham had done considerable work on weapons systems.

Graham also served as an adviser to the 1980 Reagan transition team, officials said.

"There's only been one NASA administrator [Beggs] who had NASA experience, so that's never been a criterion," said Shirley Green, a NASA spokesman for Graham.