The State Department reacted yesterday to the detention and expulsion of four American tourists from Poland last week by warning U.S. citizens "to exercise extreme caution" when visiting the Krakow area where the incident occurred.

"In view of the recent erratic and arbitrary behavior of law-enforcement and security officials in the city of Krakow, U.S. citizens visiting the Krakow area are advised to exercise extreme caution," department spokesman Ed Djerejian said.

He added that the travel advisory will be reviewed after 30 days. Other department officials said privately that while no further action was planned, the United States was keeping its options open until it saw whether the incidents in Krakow that have caused tensions in U.S.-Polish relations had ceased.

The four Americans -- two members of a visiting basketball team and a middle-aged couple -- were detained overnight May 3 and then expelled after Polish authorities charged that they had taken part in an antigovernment demonstration and thrown rocks at police. The United States characterized the charges as "preposterous."

A few days earlier, Poland expelled two U.S. diplomats, charging that they had marched in an antigovernment parade near Krakow. The United States retaliated by expelling four Polish diplomats, and Poland then barred further courier flights by U.S. planes serving the American Embassy in Warsaw.

In another matter involving U.S. relations with Eastern Europe, the department yesterday criticized as "unwise and inappropriate" the House's 322-to-93 vote urging President Reagan to declare Soviet Ambassador Anatoliy Dobrynin persona non grata unless Moscow apologizes for the March 24 killing of U.S. Army Maj. Arthur D. Nicholson Jr. by a Soviet sentry in East Germany.

Saying that "we share the sense of outrage felt by the American people and the Congress" over Nicholson's death, Djerejian added:

"Under the Constitution, the receiving of foreign ambassadors is a power reserved exclusively to the president. We do not believe that threats to declare Ambassador Dobrynin persona non grata constitute a useful step in our efforts to resolve our differences with the Soviets."