The Soviet government has agreed to send a major dance company and a theater company to perform at the 1984 Olympic games in Los Angeles, an Olympics organizer said yesterday.

The Moiseyev Dance Company, a folk dance group that last performed in the United States in 1974, and the Rustaveli Theater, which has never performed here, are the two groups slated to appear. The Kirov Ballet, considered the fountainhead of classical ballet, was previously mentioned in discussions between the two countries, but the Soviets chose to send the Moiseyev, which was the Olympic organizers' first choice.

One "essential link" in the discussions with the Soviets, according to Robert J. Fitzpatrick, director of the arts festival planned as an adjunct to the Olympics, was the help of Armand Hammer. An art collector and philanthropist, Hammer has had unique cultural and business ties to the Soviet Union for more than half a century. Three weeks ago, he made a two-day trip to the Soviet Union on behalf of the Olympic committee.

In an interview yesterday at the Corcoran Gallery of Art, Hammer characterized the negotiations as "up in the air" before his trip. He left the Soviet Union confident that the remaining problems were scheduling ones.

"I think it's largely a matter of touring dates," said Hammer.

"I think it opens the door for further exchanges. I'm hopeful we'll have reciprocity--in other words, have American artists and performers go to Russia," Hammer said of the Soviets' decision to send artists here. "I'm a great believer in cultural and trade exchanges. The relations are the worst I've seen them in 60 years between the two countries."

"We've been without contact with Russian culture for some time," said Fitzpatrick. "This is a very major coup to bring two major companies from Russia here . . . Considering the fact that the U.S. boycotted the Olympics in Russia in 1980, to protest the Soviet invasion of Afghanistan , I think this is a particularly warm gesture on the part of the Russians."

Fitzpatrick called the Moiseyev a "brilliant choice" for the festival that will include 18 dance companies from around the world. "We were strongly represented in contemporary dance and strongly represented in ballet," he said. "We needed one more major folk dance company."

Fitzpatrick yesterday received a telex from Gosconcert, the official Soviet agency for cultural performances outside the Soviet Union, telling him "they are prepared to move forward," he said. Fitzpatrick will go to the Soviet Union in September to see the companies, discuss details and probably get signed contracts.

The arrangements for the performances come after "two and a half years of discussions and multiple explorations and contacts," said Fitzpatrick. "It reaffirms the fact that the Olympic games ought to be outside of politics. It was an egregious error on the part of the U.S. to boycott the Olympics."

Hammer, who said he had no difficulties in his discussions with the Soviets, talked with the first deputy minister of culture, Yuri R. Barabach. He went as a special, unpaid assistant to the president of the Olympic organizing committee. "I don't even get a dollar," Hammer chuckled. Asked if he was also representing the Reagan administration in any form, he shook his head and said, "Just the Olympic committee."

He did, however, say that officials at the State Department "had no objections to these two events coming. They did not express themselves for or against it. They said they would take care of the necessary visas."

Hammer has recently traveled to other Communist countries. "I've been to Hungary," he said of a trip he took a few months ago. "I promised my collection will be shown in Budapest."

That collection will be exhibited at the Fine Arts Museum of Hungary from June 6 to July 31.

"I've been to China," he said, "but I haven't discussed any cultural exchanges with China."

Hammer forged business relations with China after meeting Chinese leader Deng Xiaoping at a Houston barbecue several years ago. On his recent trip, Hammer, who heads Occidental Petroleum Corp., signed an agreement with the Chinese Ministry of Coal that allows Occidental to develop the largest open pit coal operation in the world.