The departure from powerful positions of three prominent generals has aroused speculation that President Chun Doo Hwan is engaged in a political housecleaning to consolidate his rule in South Korea.

All three had been close friends and advisers of Chun when he began accumulating power here in December 1979, and all occupied posts in his government that traditionally have been regarded as crucial in any power struggle here.

Government officials deny that the three cases are related. Only one of the generals has been dismissed with the sort of public disgrace that accompanied the purges of the military that followed Chun's accession to the presidency.

But to many observers, both foreign and South Korean, the changes appear to fit a pattern of potential rivals being displaced at a time when Chun's prestige and power are rearely questioned publicly.

The most recent case involved Maj. Gen. Pak Sae Jik, who had been commander of the Capitol Garrison Command, the military unit assigned to defend Seoul. It is a post also regarded as politically important in the event of uprisings within the military, such as the one Chun led against former Army bosses after the assassination of president Park Chung Hee.

Pak had been given the key post by Chun, but early this month ws stripped of his command retired from the Army on grounds of alleged corruption.He was accused publicly -- but not prosecuted -- on charges that he had abetted a former Army friend who was seeking business favors from Cabinet ministers.

His dismissal was portrayed officially as an example of Chun's unswerving resolve to cleanse the government of the kind of favortism and influence-peddling considered common here among generals and officials in the former administration.

Since Pak is not to be tried, the truth of the allegations may never be tested in public. But several observers believe there is more to the story. One diplomatic source pointed out that Pak had moved far beyond his military role and had become a well-known personality in political and diplomatic life here.

Another high-level change that has many baffled was the sudden retirement earlier this summer of Gen. Ro Tae Woo, a long-time friend of the president and a key figure in the Dec. 12, 1979, incident that gave Chun and his cohorts control of the Army.

Ro had led troops into the capital to secure it against the resistance of old-guard generals whose chief was being arrested by Chun's men. His movement was the key maneuver in sealing Chun's victory that night and Ro came to be regarded as one of the four or five top generals who steadily expanded their control and placed Chun in power.

Last month, it was unexpectedly announced that Ro would retire from his position as head of the Defense Security Command, the powerful military agency that had previously served as a launching pad for Chun himself. The post has vast surveillance and police powers and whoever fills it automatically wields considerable political influence.

Ro doffed his uniform after an elaborate retirement ceremony and became a minister without portfolio, a civilian political post which in the past has been regarded as having little significance. His exact duties are not clear. One government official said Ro is a special assistant to Chun for foreign affairs. Another said he acts as liaison chief between the presidential office and the virtually powerless National Assembly.

Despite Ro's seemingly minor position, government officials encourage speculation that he may have been moved out of uniform to become a civilianpolitician in line to succeed Chun, whose term expires in 1988. One official said the government hopes to avoid a repetition of the Chun accession in which the president-to-be takes off his uniform only a few days before being inaugurated.

Despite the disavowals, the impression left with foreign diplomats stationed here is that Chun was not happy with a potential rival of such stature. Ro is extremely popular with the military brass.

"I think that Chun just felt uncomfortable with Ro in that position," said one diplomat.

Government sources say Chun and Ro are still friends and meet frequently, although there are no visible signs that the president has given him any important business to conduct.

A third general, Brig. Gen. Chung Dong Ho, was removed on July 13 from his position as chief bodyguard for the president in the Blue House, the presidential mansion.That too was a position of political significance under the late president Park, whose own bodyguard wss slain with him in the political assassination of October 1979.

Chung's removal was not widely known publicly. The explanation offered by one top aide is that Chun did not want the position of bodyguard to become a permanent assignment as it had in the past and intends to change bodyguards frequently.