Disavowing earlier threats, the head of Iran's central bank said yesterday that his government will pay all its foreign obligations, but "reserves the right later to go into court" to contest loans it determines were corrupt when they were made.

But a lawyer representing the Iranian government noted separately that Iran cannot pay off its U.S. loans until the U.S. government unfreezes its assets here. They were frozen a month ago, as one U.S. response to the seizure of Americans at its embassy in Tehran.

Last month, Iran's Finance Minister Abol Hassan Bani-Sdr declared in an economics message that all foreign debts would be canceled.

That created an instant uproar and Bani-Sadr backed off, saying on Nov. 23 that he had meant only that those "debts contracted with plunderers" during the shah's rule would not be paid. In that category he placed loans from 28 banks privately owned under the shah but nationalized by the revolutionary government.

Yesterday, in a telephone interview from New York, Ali Reza Nobari, governor of the Iranian central bank, said "the government always meant to pay its legitimate debts" and that Bani-Sadr, his boss, "had never said anything different."

Nobari, who has held his job less than two months, is on a world tour to persuade bankers that Iran is a rational customer, safe to deal with. His mission is of fresh importance now that the United States is pressing the United Nations for economic sanctions against Iran.

But while saying yesterday that Iran would pay its debts, Nobari also said that where records suggest corruption -- for example, when a loan amount was padded to provide funds for kickbacks as well as to pay for goods and legitimate services -- the Iranians will go to court to recover both the face amounts and "punitive damages."

President Carter's decision Nov. 15 to freeze Iranian government assets held by U.S. banks and branches, combined with Bani-Sadr's statements on treatment of foreign debts, led to a flood of lawsuits in this country and abroad as creditors sought to protect their interests.

Nobari said yesterday "about 100 lawsuits have been filed against us" in the United States by American banks and concerns that want payment for loans or goods, or compensation for nationalized assets.