Arson attacks, apparently spawned by anti-American feeling, struck two West German cities following yesterday's parking lot explosion at the U.S. air base in Ramstein.

Several West German newspapers warned today that the growing antimilitary and anti-American sentiment in West Germany -- fanned partly by political opposition to NATO plans for stationing medium-range missiles in Western Europe and the U.S. decision to build neutron weapons -- created a climate that encouraged a revival of terrorist activity.

In Wiesbaden, site of a U.S. air base, seven cars, five of them with license plates indicating American ownership, were set ablaze last night in a district where U.S. servicemen live.

A fire set by arsonists today gutted the conference room at the Frankfurt office of West Germany's ruling Social Democratic Party, causing an estimated $125,000 in damages. Slogans denouncing "U.S. imperialism" and Social Democratic support for U.S. nuclear arms strategy were found sprayed at the entrance to the building, and police linked the writing to the arsonists. Chancellor Helmut Schmidt's Social Democratic Party is divided over NATO's so-called theater nuclear forces modernization program.

At Ramstein, meantime, investigators examined debris from the Monday morning blast that injured 18 U.S. servicemen and two West German civilians and damaged the headquarters of the U.S. and NATO European air commands. The two U.S. officers most seriously hurt when an explosive device, thought to have been placed under a parked car, went off, were reported today to be in good condition following facial surgery.

A spokesman for the West German prosecutor's office in Karlsruhe, which has charge of the investigation, said that no firm clues had been found pointing to who was responsible for the attack.

The spokesman said the attack, which West German authorities suspect was the work of left-wing terrorists, had "all in all been very professional." But he said the idea that the blast marked the start of a new series of West German terrorist actions was purely speculative.

Nonetheless, the target and style of the attack appeared to conform to a terrorist "strategy paper" that West German police found last year in a raid on a hideout in Heidelberg linked to the extreme leftist Red Army Faction, a terrorist group that West German officials assumed to have been much weakened by the jailings and deaths of several of its members in recent years.

The paper reportedly contained a rough outline of concepts for continued terrorist combat and sketched plans for possible attacks on Ramstein and other U.S. military facilities in West Germany. Also discovered in the hideout, according to a West German television report, were leaflets from an earlier "open house day" at Ramstein.

Investigators suspect that whoever planned yesterday's blast must have carefully surveyed the air base earlier. The spokesman for the prosecutor's office said investigators were not prepared to connect the papers found in Heidelberg with the Ramstein explosion, but he said the possibility of a link was being studied.

The terrorist strategy paper had seemed to gain significance last February in statements to a West German news magazine by a former Red Army Faction member, Peter Book, who disclosed that among the group's plans had been the kidnaping of senior U.S. officers during a festival ball held in a Heidelberg castle each year.

If the Ramstein blast is tied to West German leftist terrorists, authorities here will have to review policing tactics against forces that they had thought were on the wane.

The Red Army Faction, founded by the late Andreas Baader and Ulrike Meinhof, was responsible for several years of intensely violent activity in West Germany through 1977. West German security officials believe the group's last major operation was the attempted assassination in Belgium in June 1979 of Alexander M. Haig Jr., who was then the commander of NATO.

There are 13 so-called hard core Red Army Faction members still at large, according to officials, and perhaps several hundred sympathizers and friends in West Germany.

Specialists on terrorism believe the Red Army Faction has been succeeded by a patchwork of smaller groups that call themselves the Revolutionary Cells.

Last May, the cells claimed responsibility for the killing of Heinz Herbert Karry, finance minister of the state of Hesse and national treasurer of the Free Democratic Party, who had clashed with environmental groups over nuclear energy and controversial plans to expand the Frankfurt airport.

West German officials have said they believe a number of fugitive West German terrorists are receiving training and shelter from the Palestine Liberation Organization in Lebanon.

A Bonn Interior Ministry report on terrorism last month said that leftist violence in West Germany has been on the rise since the spring of 1980, finding fertile ground in the growing antinuclear missile drive and West German environmental campaigns and in various squatter demonstrations. The number of bombings and cases of arson laid to left-wing terrorists was 77 last year, almost twice as many as the year before. That number has already been exceeded this year.