Chinese Communist Party Chairman Hua Kuo-feng gave a ringing endorsement to Romania's independence yesterday, asserting that the two countries share "common objectives," and declaring that Peking is not afraid of war against those who want "to rule the world."

While Hua did not single out the power seeking to dominate the world by name his remarks appeared to have been primarily directed toward Moscow.

The Romanians have been at odds with the Kremlin over Bucharest's independent foreign policy and have been criticized for cultivating close relations with China.

Recalling that two world wars were started in Europe, the Chinese leader said, in a statement published here, that "today Europe has again become an important objective disputed by some big powers that try to rule the earth.

"Faced with the danger of a new war, the peoples are becoming growingly aware of it (and) rise to struggle at various levels against the forces of war.

"But if by all means these want to impose war on the peoples, we are not afraid."

Saying that former world empires have "turned to dust," he added that today those who seek "in vain" to rule the world, will, even if for a while they may enjoy their folly, meet with the same fate in the end."

In what seemed a pledge of support for Romania's pursuit of an independent policy, Hua said that China and Romania are bound "by common destiny" and that "today the common objectives - defense of independence and sovereignty and building socialism - unite us still more."

Hua delivered the speech Wednesday night at a banquet in his honor which was attended only by Chinese and Romanian officials. The text was published in the Romanian Communist newspaper Scinteia yesterday.

Although Hua avoided the type of attacks on the Soviet Union that have become customary in the speeches made by senior Peking figures, his message to the Kremlin was clear.

Romanian President Nicolae Ceausescu, in his speech Wednesday night, expressed appreciation for "the growingly important role the Peoples Republic of China is playing in the world area."

Ceausescu also spoke about the "growing tendencies of redividing the zones of influence (and of promoting the policy of domination in various parts of the world." But he was far more restrained and oblique in his criticism of Moscow than his Chinese guest.

Yesterday, Romanian officials displayed a good deal of nervousness and sought to portray the unprecedented visit by the leader of China to Europe as a bilateral matter whose principal focus is the development of trade relations.

Hua, on the second day of his trip, was given a guided tour of the city that included a stop at a machine tool factory and a visit to a local supermarket.

The supermarket turned out to be a Potemkin village affair. The shop of Drumul Taburuhui was stocked with all sorts of delicacies and cuts of meat that Romanians normally do not see. A red carpet was rolled out for the visit. It was rolled back after his departure and the doors to the shop were shut.

The 58-year-old Chinese leader appeared vigorous and trim. Western observers who knew him before he assumed power in Peking said that Hua's hair had been dyed jet black (it was said to heave been almost completely white before and that his general appearance now is much more dapper.

The Chinese leader, who is almost six feet tall, has also lost some weight. His tunic was elegantly tailored and made of excellent cloth.

Yesterday afternoon he met with the ambassadors of countries accredited to Romania. There were no speeches on that occasion and the reason, according to diplomatic speculation here, is that protocol would have required that the Soviet ambassador, as dean of the diplomatic corps here, deliver the welcoming address.

The ambassador from Albania, once China's only European ally, attended the meeting. Albunia recently denounced China after Peking suddenly withdrew its aid and technical personnel from Albania.

Hua's speech although moderate in tone, suggested unmistakably that Peking intends to conduct a dynamic policy in an effort to create what it calls a "united front" against the Soviets.

On Aug. 21, the date that marks the 10th anniversary of the Warsaw Pact Invasion of Czechoslovakia, Hua is scheduled to end his visit here and begin a seven-day trip to Yugoslavia, a nonaligned Communist country that has been at odds with the Kremlin ever since President Tito bolted the Soviet bloc 30 years ago.