Only two days after he was fired as president of United Press International, Luis Nogales yesterday was negotiating with the company's principal owner, Douglas Ruhe, on a corporate refinancing plan that might save the embattled wire service from bankruptcy.

The abrupt role reversal by Nogales, who appeared to be acting on behalf of the company's creditors, brought new hope to UPI employes that an agreement to refinance the wire service might be imminent.

In light of the company's estimated $17 million in debts, however, failure of the talks likely would seal UPI's doom, sources said. The wire service, which was founded in 1907, has about 2,000 employes and more than 260 bureaus worldwide.

"It's a very volatile situation," Ron Cohen, the wire service's managing editor, said last night. "If anything is going to happen, it has to happen this week. I can't see things going on past this week."

Nogales, who was brought in to run UPI six months ago and then was fired Sunday night, apparently has won the confidence of the company's creditors and now appears to be acting for them in negotiations going on in Los Angeles, Cohen said.

"Clearly, he Nogales is working as a bridge between the owners and the creditors," he said. "He's back in the picture."

A spokeswoman for UPI owners Ruhe and William Geissler refused to comment on the negotiations last night. A UPI story last night reported that "pressure was building" on Ruhe and Geissler to accept an agreement whereby they would give up most of their 90 percent interest in the company to its biggest creditors, including its chief lender, Foothill Capital Corp.

In exchange, the creditors would forgive the company's debts and, after a company reorganization, new investors would be sought to inject badly needed new capital, according to UPI. The story reported "speculation" that ousted president Nogales would return to again head a reorganized UPI.

Cohen said last night that Geissler told him the owners were engaged in talks with a potential new investor who was involved "in the media."

The key development as far as staff morale was concerned, however, was the reemergence of Nogales, who has strong support among the employes.

"The whole situation is much more optimistic than it was yesterday," Cohen said. "The feeling among the staff was that the owners had presented Nogales as the knight on a white horse who was going to save UPI. Suddenly, the very person was supposed to be our salvation was gone. Now the feeling is generally upbeat."

Last night's UPI story also quoted a UPI lawyer as saying that meetings involving Ruhe, Nogales and the creditors were going on throughout the day yesterday in Los Angeles. It also said that Richard Pattison, international representative of The Newspaper Guild, flew to Los Angeles to tell Ruhe the union supports Nogales and demands that Ruhe and Geissler surrender majority control of the company.

"The guild has one key goal in its discussions with all parties to the current unsettled situation at UPI -- to protect the interests and futures of its members," said Dan Carmichael, secretary-treasurer of the Wire Service Guild, which represents 900 UPI employes and is part of The Newspaper Guild.

The stumbling block that lead to Nogales' firing was demands by Ruhe and Geissler that they maintain a significant interest in a restructured company. Ruhe and Geissler, two Nashville businessmen who bought the money-losing wire service for $1 in 1982, had demanded that they retain a 25 percent liability-free interest in the company and receive annual consulting fees and commissions, according to a UPI story Monday.

When Nogales told them that he and Foothill found this demand "unsaleable" to the other creditors, Ruhe fired Nogales and financial consultant Ray Wechsler, the story said.

However, a story in yesterday's edition of The Tennessean newspaper in Nashville, quoted sources close to Ruhe and Geissler as saying the firings were prompted by Nogales' and Weschlers' efforts to negotiate an agreement with Foothill that would wrest control of UPI from the two owners. The story said that Nogales and Weschler were trying to negotiate a 25 percent stock transfer to themselves and other executives while reducing Ruhe's amd Geissler's share to 8 percent.

Contacted by the Tennessean, Nogales denied this version, calling it "absolutely false."

The Associated Press reported last night that the Tennessean said in today's editions that Ruhe had tentatively agreed to rehire Nogales, Wechsler and three executives who resigned Monday. The wire service said telephone calls to UPI's Washington office last night for comment on the Tennessean report were not returned.