Poland's ideological chief, Stefan Olszowski, resigned his powerful post in the Communist Party Secretariat today in the most far-reaching leadership shake-up since the imposition of martial law in December.

Olszowski's removal as party secretary for propaganda was interpreted here as part of a move by the martial-law chief, Gen. Wojciech Jaruzelski, to consolidate his political position. Olszowski long had been regarded as the leading hard-liner in the ruling Politburo and a possible successor to, or rival of, Jaruzelski.

The 50-year-old Olszowski, however, retained his seat on the Politburo, and it was rumored that he may be appointed foreign minister--an important post but removed from key internal policy decisions.

The price for Olszowski's removal as party secretary appears to have been the resignation of two politicians associated with the relatively moderate faction in the Communist Party leadership. Hieronym Kubiak lost his position as party secretary responsible for education and culture and Jan Labecki, the party secretary in the Lenin Shipyard in Gdansk, was dropped from the Politburo altogether.

Kubiak was widely credited with shielding the intellectual community from an ideological purge of the kind journalists underwent shortly after martial law was imposed. His removal could mean that the leadership intends to pursue a tougher policy toward universities and colleges when they end their recess in the fall.

Reports had been circulating in Warsaw for months that Jaruzelski wished to move Olszowski away from the highly sensitive post of propaganda chief. As the party's overseer of television, radio and the press, he consistently pressed for ideological conformity among journalists and for rigid Communist Party controls.

A controversial but able politician, Olszowski has undergone dramatic ups and downs during the past few years. He clashed with the former Communist Party leader, Edward Gierek, and was exiled as ambassador to East Germany, only to return to the Politburo following the labor upheavals in August 1980. The changes in the Politburo came on the second day of a plenum of the 194-member Central Committee called for the ostensible purpose of discussing ways of winning back millions of alienated young Poles to the party.

Political observers suggested the shake-up could be connected with plans by Jaruzelski to announce some relaxation in martial law in connection with Poland's national day on July 22.

Jaruzelski, who holds the posts of premier, defense minister and Communist Party leader, appeared to have further consolidated his position by expanding the membership of the Politburo. New full members are Stanislaw Kalkus, a machine-tool operator from Poznan, and Marian Wozniak, who was chosen last month as party first secretary in Warsaw.

Two economists loyal to Jaruzelski, Jan Glowczyk and Manfred Gorywoda, were elected as party secretaries to fill the gaps left by Olszowski and Kubiak. But it was not known how responsibilities would be divided within the Secretariat.