James Clement Dunn, 88, a career ambassador of the U.S. Foreign Service, died Tuesday at Palm Beach Gardens Community Hospital in Palm Beach, Fla., following a heart attack. Mr. Dunn and his wife, Mary, had been vacationing at nearby Hobe Sound, Fla.

Mr. Dunn's career in the Foreign Service began in 1919 and ended in 1957. He had served as U.S. ambassador to four countries and rose to the rank of career ambassador, the highest in the service.

He was an expert on European political relationships and had wide experience in foreign posts as well as in the State Department. He was a principal adviser to secretary of state Cordell Hull in the 1930s and World War II. During most of those years he also was director of the State Department's office of European affairs. In addition to advising Hull, he was a counsellor to secretaries of state Edward R. Stettinius, Ja,es F. Byrnes, George C. Marshall and Dean Acheson.

Mr. Dunn was a member of the U.S. delegations to several major conferences during and after the war years. They included the Dumbarton Oaks meeting in Washington, the Berlin conference in 1945 and the San Francisco conference that established the United Nations. He also attended the Paris Peace Conference and the foreign ministers conferences in Paris, London and New York in 1945 and 1946.

He then embarked on a distinguished career as an embassador. He was U.S. ambassador to Italy from 1946 to 1952, ambassador to France in 1952 and 1953, ambassador to Spain from 1953 to 1955, and ambassador to Brazil from 1955 to 1956.

On the occasion of his retirement, The Washington Post recalled in an editorial that "Jimmy" Dunn had served, among other things, as a kind of press spokesman for the uncommunicative secretary of state Hull.

"Mr. Dunn's stock went up and up with the newspapermen," the editorial said, "and he came to be appreciated as fine public servant, with a great knowledge of diplomatic precedent and history which made him one of the best ambassadors of our times."

Mr. Dunn was born in Newark, N.J. He was educated privately and embarked on a career as an architect. During World War I, he was commissioned in the Navy and served as an assistant naval attache in Havana, Cuba, from 1917 to 1919. He became a clerk in the State Department after leaving the Navy and soon after passed the examinations for the Foreign Service.

His early posts were in Haiti, Spain and Belgium. From 1927 to 1930, he was director of ceremonies at the White House and chief of protocol in the State Department. He served breifly in London, Geneva and Uruguay before being appointed a special assistant to Hull in 1934.

Mr. Dunn maintained a home in Washington from 1927 until his retirement in 1957. He then lived in Rome. He had lived in New York City since 1977.

Survivors include his wife, the former Mary Augusta Armour, whom he married in 1914, of the home; two duaghters, Marianne Dunn, of New York City, and Mrs. Lorenz Esterlechner, of Bavaria, Germany; four grandchildren, and nine great-grandchildren. CAPTION: Picture, JAMES C. DUNN, 1955 Photo