The 300,000 foreign tourists expected to attend the 22nd Olympic Games here next summer will add up to the largest peaceful influx of outsiders in the long and tangled history of invasion-prone Russia.

Among the horde will be an estimated 20,000 Americans, packaged into the Soviet Union by the Russian Travel Bureau, Inc., of New York, the officially designated general sales agency for tickets and travel to the 1980 Olympics.

What these vistors see, hear and experience in Moscow and the four other Olympic venues of Leningrad, Kiev, Minsk and Tallinn is of crucial importance to the Soviet government for political and ideological reasons.

Foreigners afoot here - be they casual tourists or resident diplomats - always have encountered a confusing combination of suspicion, duplicity and warmth. It is a Russian tradition, arising by turns from the nation's many armed invasions by outsiders, its relative poverty which no one is eager to display, its cultural estrangement from the rest of Europe and its vast, sentimental heart. The Soviets have not ended that contradictory tradition, nor will they for the tourists coming to the Games.

Wherever the line may lie between genuine hospitality and cynical deception, the Soviets seem sure to cross it.

In part, this is because the foreigners enjoy much higher living standards.

Already, canned goods are disappearing from city food stores. Russian friends chalk it up to restaurant hoarding to insure adequate supplies during the Games from July 19 to Aug. 3, 1980.

The highly touted, handsome array of souvenirs designed for the Games seldom are seen in Moscow shops. That also is attributed to official hoarding. Apartment projects in the housing-short city have lapsed while the state concentrates on its massive program of new construction and renovation for the athletes, spectators and press.

The sheer number of tourists, swelled by an estimated 300,000 additional visitors from fraternal socialist countries, will strain the city's services in many ways. Massive efforts are under way to improve food services, accommodations and entertainment. Some 4,500 taxi drivers are learning basic English, French, German and Spanish. Thousands of foreign language students will be guides.

Moscow's 50,000 hotel beds will be increased by 28,000, including a 10,000-bed giant hotel where Olympic officials will be quartered. Another 150,000 beds in 173 student hotels and 14,000 in city boarding schools will be available, plus about 2,500 in a new Sputnik youth travel camp and several new camping sites. Students at prestigious Moscow State University, in the Lenin Hills across the Moscow River from the Luzhniki sports complex, will be ousted from their dorms on April 1, it is understood, so the space can be refurbished for the guests.

Pravda, the official Communist Party daily, reports that no fewer than 200,000 Moscovites will service the games. "They consider it a matter of honor to create all conditions for the Games' success," Pravda says.

Nikolai Zavyalov, the city catering chief, said Moscow's eateries will be increased by 100,000 seats to handle up to 820,000 people at once. More than 7,000 cooks and pastry chefs are being trained, and 27 restaurants and cafes will specialize in national cuisine, such as blini (pancakes with caviar), rasstegai (tart-shaped meat pies), pelmeni (Siberian meat dumplings) and ukha (fishs soup). All told, 10 million rubles - about $15 million - will be spent for these improvements.

An enormous cultural program also is being arranged, displaying the riches of Russia's trove of musicians, dancers, poets and acting companies, as well as major foreign orchestras.

The Bolshoi theatre will send stars like Maya Plisetskaya, Natalia Bessmertnova, Yevgeny Nesterenko and Vladimir Vasilyev before the lights.

There will be separate "days" of Soviet music, film, theatre and circus. The program includes national folk troupes such as the Moiseyev Dancers, as well as such famed ensembles as the London Symphony Orchestra. In all, more than 50 musical groups are scheduled to perform, as well as dozens of folk "collectives." Moscow's best theatres, including the worldfamed Central Puppet Theatre, will be in virtually continuous performance.

In any normal summer month, foreign travelers number about 22,000 here. The authorities will reduce the crunch next summer by arranging tour packages in such a way that not more than about 100,000 foreigners will be in the city at any one time.

This will ease service problems, as well as security. The Soviets are not eager for free intermingling of Russians with the foreigners, and the media recently warned the people to be on guard against "poisons" spread by foreigners.*tFor the American tourists, the Soviets have offered about 8,000 beds, of which the Russian Travel Bureau has selected about 6,500 as suitable. The American Package Tours, of either 15 days or 22 days, also will include side trips to such places as Leningrad, Kiev, Minsk and Tallinn, where the other Olympic venues are, as well as to Siberia.

Here in Moscow, 219,000 tickets have been allotted to the United States - the largest single foreign bloc of seats. Of these, 100,000 are reserved for the favorite American sports of track and field, 60,000; boxing, 15,000; swimming, 10,000; basketball, 10,000; gymnastics, 5,000. The rest of the tickets are spread among such sports as soccer, 4,000; equestrian; rowing; cycling, and shooting.

Choice will be on a first-come, first-served basis, but those arriving with tickets to events they do not fancy may have success in swapping them at hotel barter stations with tourists from other countries where sports such as soccer and equestrian are followed more closely.

The Soviets, with their closed borders, unease about foreigners and long bureaucratic history, are sticklers for documents. Anticipating a more-than-usual number of tourist foul-ups, the U.S. Embassy plans to add two consular officers to the usual complement of four. Other experienced consular officers may be brought in as needed if the embassy gets swamped.

For medical attention, tourists must rely on the Soviet health authorities. The small embassy clinic, which includes a senior State Department physician, is officially responsible only for U.S. government employes. However, the staff may be beefed up to handle extraordinary requests.

The Soviets have promised to supplement road signs now unreadable to most Americans. The Moscow Metro, one of the splendors of this city, should be equipped with signs in English and other foreign languages by the time the Olympics open.