Loretta Cornelius, acting director of the Office of Personnel Management, tried to fire her former boss, Donald J. Devine, from his temporary job as her special assistant this week, apparently in an attempt to stave off a potentially embarrassing congressional hearing, OPM and congressional sources said.

After discussions with White House officials, Devine instead resigned on Wednesday, but said he expected to win Senate confirmation "within a month" for another four-year term as head of OPM.

Devine's statutory term lapsed March 26, but an arrangement was made for him to take a $2,800 pay cut and serve under Cornelius. Cornelius, 49, came to OPM in 1981, after working her way up the ranks of PRC Data Services Co. of McLean. The Warrenton resident served as a fund-raiser for Sen. John W. Warner (R-Va.) in his 1978 campaign.

An OPM source close to Devine said Cornelius had signed a letter delegating responsibilities for certain duties to Devine. But Cornelius said yesterday that although she had signed a personnel form creating Devine's position, she did not give him any specific "authority" to act. Congressional sources, meanwhile, said Devine drew up a document before he gave up the OPM directorship giving himself that authority.

According to sources at OPM and on Capitol Hill, the unusual arrangement began to unravel on Monday, after Rep. Patricia Schroeder (D-Colo.), chairman of the House Post Office and Civil Service subcommittee on civil service, arranged to meet with Cornelius.

Schroeder, who has tangled with Devine repeatedly during the past four years, told Cornelius that it would be in her best interest to "improve relations with Capitol Hill" and to "separate her policies from those of Mr. Devine," according to Andrew C. Feinstein, the subcommittee staff director who attended the meeting.

When Cornelius could not outline any new policies, Feinstein said Schroeder asked, "Are you in charge?" As the meeting was breaking up, Feinstein advised Cornelius that a congressional hearing might be scheduled in which she, Devine and their senior aides would be asked to testify about the division of responsibility.

Schroeder could not be reached for comment.

The next day, Cornelius read in The Washington Post's Federal Diary column about a dispute between OPM and the subcommittee over the extent to which the federal work force had been trimmed since President Reagan took office, and how employes were counted. The column quoted one of Devine's senior political aides, Patrick S. Korten, as saying that Schroeder had supported the OPM method and adding, "If she wants to do something about it, she can. It is time for Ms. Schroeder to put up or shut up."

OPM and congressional sources say that was the last straw for Cornelius, who had often disagreed not only with Devine but also with Korten on agency issues. Feinstein said he called Cornelius and asked whether Korten's remarks reflected her point of view. He said she said no. She then reportedly asked Korten to apologize to Schroeder; Korten then phoned Feinstein to convey his apologies.

But the damage was done. According to sources, Cornelius Tuesday consulted with the White House and then asked Devine to step down, and began the process of firing Korten and public affairs director Mark S. Tapscott, another Devine aide.

John L. (Len) Kill Kelley, who was installed Wednesday as acting public affairs director, said Cornelius' "actions were geared toward assuring that there were professional relationships with the Hill."

That morning, both Korten and Tapscott were relieved of their responsibilities, but by the end of the day, Korten had been reinstated after Devine intervened. Tapscott remains director of public affairs, but has been instructed not to talk to the press.

Devine, meanwhile, was working to resolve his own situation with the White House. A compromise was arranged and at 4:45 p.m. Wednesday, it was announced that Devine would "go home" until he was confirmed to "clarify lines of authority" within OPM.

Yesterday, one OPM source said Feinstein "has waged an absolutely brilliant campaign to undermine Loretta's confidence in herself and to force her to take an action against Devine. I have to respect the way he manipulated the situation."

Feinstein declined to respond.