Two former top government officials warned yesterday that the United States should be careful about restricting exports in an attempt to changed the foreign or domestic policies of other nations.

George Ball, undersecretary of state in the Kennedy and Johnson administrations, told the Senate Banking Committee that denying U.S. goods to certain countries may actually make those countries more set in the policies the U.S. is trying to change.

For example, Ball said, "well-meaning" groups who are trying to isolate South Africa economically in an attempt to get that country to change its apartheid policies may be strengthening the hand of hard line Afrikaners, "unconsciously favoring a violent solution."

Ball, chairman of the investment banking firm of Lehman Brothers, Kuhn, Loeb, Intl., said he is distrubed by pressures on the administration to use exports as a bigger tool of foreign policy than they now are.

David Packard, deputy secretary of defense in the early Nixon administration, said that in trade with communist countries "national security considerations must take precedence."

But even there, Packard said, strong trade relations should be encouraged with the Soviet Union and other Eastern European countries to keep tensions "at a minimum level."

Ball said, for example, if "we keny Aeroflot (the Soviet airline) computers," it is doubtful the USSR would change its African policies and even less likely that it would change its internal policies, such as its restrictions on Jews who want to emigrate to Israel or other countries.

"Pride is a major factor," Ball said, and even countries far weaker than the Soviet Union are likely to resist changing their internal policies in response to a denial of U.S. exports.TBut Jerry Goodman, executive director of the National Conference on Soviet Jewry, said that there has been a "welcome increase in the number of Soviet Jews allowed to leave" the USSR since Congress voted in 1974 to deny the Soviet Union and other communist countries non-disriminatory trade treatment if they deny their citizens the right to emigrate.

The Soviet Union still does not have so-called "most-favored-nation" status in U.S. trade, that was denied it in the Jackson-Vanik amendment to the 1974 trade act.

Goldman said that the United States - through the 1974 trade act and President Carter's emphasis on human right - has made friends in western and other countries by "putting more principles before pecuniary interests."

All three said the government should set up an inter-agency task force that would set U.S. policies on exports to develop a consistent policy on trade.

Packard told Sen. Adlai Stevenson (D-Ill.), who chired the meeting, that export controls should be used only when:

They support "clearly defined foreign policy objectives."

They are based on an "adequate amount of factual information."

There is a likelihood that such unilateral action on the part of the U.S. will produce the results desired.

The commodities involved are not obtainable from non-U.S. sources.

The action is in harmony with other U.S. goals.

They are unlikely to hurt U.S. business.

Packard is chairman of Hewlett-Packard, a diversified West Coast electronics company that exports high technology equipment.

Both Ball and Packard said that export controls should be used sparingly and consistently because otherwise the United States will develop a reputation of being an unreliable supplier.

They said that the United States must encourage exports to help reduce the severe teade deficit that is contributing to the decline of the dollar abroad and to inflation at home.

"I don't believe that unilateral efforts do much else but lose business for the United States," Packard said. In the human rights area, he said, more would be achieved by maintaining a normal export policy and using behind the scenes diplomacy than by "putting it out front and embarrassing these people . . . A target country usually can and will receive comparable products elsewhere."