Yugolsav President Tito flew to the Soviet Union today, intent on improving badly strained relations with the Kremin but determined not to sacrifice his country's hard-won independence.

The meeting between Tito, 87, and Soviet President Leonid Brezhnev, 72, is seen here as particularly important since, given the age of the two leaders, it could well be their last opportunity to put relations between their two countries on a stable course for the future. Concern has been expressed in Yugoslavia, which broke away from the Soviet bloc in 1948, about Soviet intentions after Tito's death.

The demotion of one of Tito's closest asides, Stane Dolanc, on the eye of Tito's departure for Moscow focuses attention on the difficulties Yugoslavia will have in assuring an orderly transition to the post-Tito era.

In a surprise announcement late Tuesday night, the official Yugoslav news agency said Dolanc, 53, who was considered by many to be a possible successor to Tito had resigned from his key post as secretary of the Yugoslav Communist Party, but was retaining his membership on the policy making party presidency.

While Yugoslav commentators hailed Dolanc's resignation as a major step toward creation of a collective leadership to the rule the country, some Western diplomats expressed concern that a dangerous power vacuum could be developing within the Yugoslav party hierarchy since, with Dolanc's demotion and the death in February of Edvard Kardelji, the chief ideologist of Titoism, there is now no obvious successor to Tito.

While Dolanc's influence has been severely curtailed, he is clearly not in disgrace since he is still accompanying Tito, as planned earlier, on the week-long visit to the Soviet Union.

Brezhnev greeted Tito at Moscow's Vnukovo Ariport today and formal talks between the two are expected to begin Thursday.

Nonalignment is expected to be one of the major topics during their talks, the first since August 1977 when Tito stopped over in Moscow on his way to Peking for his first visit to China.

Addressing Yugoslavia's parliament on the eve of his departure, Tito called on nonaligned countries to strength their independence and unity. In the past he has made clear that he believes the Soviet Union is attempting to split the nonaligned movement through the disruptive activities of Cuba and other pro-Soviet nonaligned states.

Western diplomats here expect Tito to urge Brezhnev to exert a moderating influence over Cuba before the next conference of nonaligned heads of government, to be held in Havana in September. It is feared here that Cuban attempts to persuade the non-aligned movement to adopt more overtly pro-Soviet policies would undermine one of the major pillars of Yugoslavia's independent foreign policy.

The problem facing Tito, who celebrates his 87th birthday next week apparently in the best of health, is that he has little to offer Brezhnev in return. The kind of concession demanded by the Kremin in the past, such as greater access for the Soviet Navy to Yugoslavia's Adriatic ports and particpation in Warsaw Pact ideological activtiy is simply not compatible with Yugoslavia's continued independence in the post-Tito era.

A senior diplomat representing a European country in a similar position relative to the Soviet Union said: "We can well understand Tito's dilemma. There is a great temptation for the Yugoslavs to concede as much as they can in non-vital areas. But the Russians are though negotiators. They take what you give them-and then they demand more."

It is fair summary of the trap in which Tito finds himself 30 years after breaking with Moscow. For political, economic, and ideological reasons, Yugoslavia needs good relations with the Kremin. But the price demanded by Moscow for real friendship is too high, in Belgrade's view.

The result is an endless kolo -a Balkan dance in which the partners shuttle from side to side and never really get anywhere.

The tactics Tito is likely to adopty in Moscow were reflected in his carefully constructed speech to the Yugoslav parliament yesterday to mark the swearing-in of the country's celective presidencey for a new term of office.

On the one hand, he struck a conciliatory not toward the Kremin by stressing what he describe as "the progressive character of nonalignment" and its policy of anti-colonialism. He said he was going to Moscow in pursuit of Yugoslavia's wish to develop good relations with all countries.

"The more friends a country has, the stronger it is," he said in a reference to his own highly successful meetings with leaders of countries as diverse as China, the United States, North Korea, France, West Germany, Hungary, Algeria, and Iraq over the last 18 months.

But elsewhere in his speech, Tito made clear that Yugoslvia intended to stick to its own interpretation of nonalignment as a force outside the two big powers blocs. He said nonalignment could help strengthen the independence of all countries, but only if the movement's own independence and autonomy was consolidated.

Despite making reassuring noises in public, Yugoslav officals still privately believe that the Kremin has never given up its hope of one day regaining control over their country.

In a recently published volume of very candid memoirs, a former Yugoslav ambassador to Moscow and Washington, Veljko Micunovic, cited three reasons to support this view.

First, it would make the Soviet Union a Mediterranean power for the first time in its history. Second, it would again create a monolithic socialist bloc in Europe under complete Soviet control. Third, it would put an end to talk about "independence and equality" in relations between communist parties-an idea first raised by the Yugoslavs. CAPTION: Picture, Soviet President Brezhnev, right, and Tito embrace at Moscow's Vnukovo Airport. AP