"When in trouble, travel" is a maxim of presidential politics now three times discredited. Visits to Russia and the Mideast did not avoid impeachment for President Nixon. Meetings at the summit in China and with the advanced economic countries didn't give a lift to the Ford administration. And last week President Carter returned from his seven-nation trip with something less than enhanced prestige.

A measure of the trip as unambiguous and direct as an engraved invitation lies in the justification Mr. Carter offered in his interview with the television networks. In response to the first question - a question as to whether the trip had a unifying theme - the President, on the eve of his departure, said:

"Energy will be the tie that binds us together on this trip, and I hope that this will demonstrate to the American people and to the Congress the necessity for rapid action on one of the most controversial and divisive issues that the Congress has ever faced, and that is to give our country for the first time a comprehensive energy policy."

In fact, energy was not the main theme of the trip. Nor could it have been. The leaders of France, on the eve of an election, of Poland in the grip of the Russian bear and of India struggling to maintain democracy have issues of far higher priority than energy.

Even if energy had been the common denominator of the journey, it couldn't have had any effect on the legislative situation. The energy bill is now hung up in a 9-to-9 split among 18 members of a Senate committee. The same split has dominated the energy situation for months.

It is a product of past commitments, vanity, slights, ideology and interest. It is a classic case of inside politics - untouchable by anything a President says in Saudi Arabia or Iran, let alone Paris, Warsaw, New Delhi or anywhere else outside the halls of Congress.

As it happened, energy was overshadowed by one of many presidential gaffes during the trip. In his network interview, Carter was asked about what kind of Palestinian homeland he would like to see emerge from the Egypt-Israel negotiations. He said his preference was that the Palestinians "not be an independent nation, but be tied in some way with the surrounding countries, making a choice, for instance, between Israel and Jordan."

The case against not having an independent Palestinian state between Jordan and Israel is an overwhelming one frequently argued in this column. But Carter should not be talking airily on such a sensitive matter on national television in the first place. Moreover, since there is absolutely no case for linking the Palestinian entity with Israel, his statement was not only incautious, but included a monumental gaffe.

Not surprisingly, Carter spent most of the time soothing hurt feelings on that issue. He had to explain what he "really" meant in Warsaw. He had to re-explain it to the Shah of Iran and King Hussein of Jordan in Tehran, and to the Saudis in Riyadh. He had to make a special stop in Egypt to explain it again to President Anwar Sadat. He also had to make his excuses to French President Valery Giscard d'Estaing.

At the end of the trip, Carter had just about rectified his mistake. But was it truly a mistake? And how about those other "mistakes" - the ludicrously faulty translation in Warsaw and the complaint about India overheard in New Delhi through a microphone the President apparently didn't know was there?

Branch Rickey, the great baseball magnate, once observed that "luck is the residue of design." Bad luck, by the same token, happens to people who don't know what they're doing. That is an exact definition of Presidents who try to build support at home by trips abroad.

Once, perhaps - in far-off days of the imperial presidency - that tactic might have worked. No more. The cases of Nixon, Ford and now Carter show that the idea of going abroad to build support at home is a loser. Indeed, recognizing the primacy of domestic affairs is a useful point of departurre in the definition we must all begin to make of that new thing in our lives- the post-imperial presidency.