The Reagan administration told Congress yesterday that it is engaged in contingency planning to remove U.S. air and naval bases from Greece after 1988 if Prime Minister Andreas Papandreou adheres to his public position that the bases are to be closed at that time.

Richard N. Perle, assistant secretary of defense for international security policy, and Richard R. Burt, assistant secretary of state for European affairs, confirmed reports that Papandreou's criticism of the United States has caused the administration to explore "alternative" Mediterranean-area locations.

"We are indeed, as the Congress would expect us to, making sure that if we had to leave, we would not be in a situation where we would be unable to adjust," Perle said as the two testified before the House subcommittee on Europe and the Middle East.

Both he and Burt said the administration would prefer to keep the four bases in Greece. Burt said:

"We will do our best to improve relations with Greece, but the Greek government must do its part as well if there is to be progress. In the meantime, I can well understand the frustrations in Congress and elsewhere and the temptation to take punitive measures in return against the Greek government."

The two were testifying about the administration's fiscal 1986 requests that Greece be given $501 million in military aid and Turkey $939 million. That would break with Congress's past insistence that the amount of military aid Greece receives in relation to Turkey not fall below a ratio of 7 to 10.

Burt asserted that the administration wants flexibility to give security assistance where it is most needed rather than according to "a mechanistic formula that has no political or strategic rationale." But, he added, despite U.S. differences with Papandreou, the Greek aid request was based on the administration's assessment of what the United States must provide to live up to its commitments to Greece and to "preserve the common interests."

Both he and Perle sought to draw distinctions between "the short-term prospective" of U.S. problems with Papandreou and the security stake that the United States will have "for years to come" in cooperation with Greece.

In response to questions from the committee, they acknowledged that the administration is unhappy over such actions by Papandreou as his refusal to participate fully in the North Atlantic Treaty Organization, his pursuit of better ties with the Soviet Union and his criticisms of the United States including the charge that the South Korean airliner shot down by Soviet aircraft in September 1983 was on a U.S. spy mission.