Secretary of State George P. Shultz complained that Turkish officials had "sandbagged" him last weekend when they publicly linked increased textile sales to the United States to the renewal of an agreement on American military bases in Turkey.

This ploy by the government of Prime Minister Turgut Ozal during the secretary of State's visit provided a new twist in the United States' complex network of security and economic relations and raised concern that other U.S. allies among less-developed nations will attempt the same linkage between trade and bases.

It also demonstrates that trade is playing an increasingly important role in U.S. foreign policy.

The Turkish demands came as American trade officials at Geneva talks on a new multifiber arrangement (MFA) were pressing for reductions in textile exports to the United States. The reductions are being fought by supplier nations, many of which have security or regional economic ties with the United States.

Many of the countries where there are U.S. bases -- such as Spain, Portugal, South Korea and the Philippines -- also want increased sales in the United States, as do other nations such as China, India and debt-burdened Latin countries with which the Reagan administration is trying to forge closer ties.

A key element in the administration's creation of warmer ties with China and India over the past year, for example, was allowing those countries increased access to U.S. technology. But both China and India cite U.S. barriers to sales of many of their products, especially textiles, as major irritants, and three years ago Peking stopped buying American grain in retaliation against new limits on its textile sales.

The security relationships between the United States and other countries often loom as an undercurrent in trade negotiations, but thus far it rarely has worked the other way. Questions of giving a country increased trade access to U.S. markets generally don't surface in security negotiations, as they did when Shultz visited Ankara last weekend with the hope of concluding an agreement to renew a base agreement with Turkey.

"It is not unusual for officials to raise the textile quota and try to put the United States on the spot. It is unusual, though, to link it publicly to security concerns," said I. M. Destler, a senior fellow at the Institute for International Economics who specializes in the public-policy aspects of trade.

More often, countries seek increased aid levels in return for bases or security alliances. The Ozal government switched to increased trade, however, after U.S. officials said budgetary considerations didn't permit the aid increases Turkey wanted.

"If I give them bases, I want an increase in trade in return," Ozal said last October. He said Turkish exports to the United States should jump from their 1984 level of $433 million to $3 billion.

In negotiations here prior to the Shultz visit to Ankara, Commerce Secretary Malcolm Baldrige and U.S. Trade Representative Clayton Yeutter increased Turkey's textile quota from $120 billion last year to $190 million -- a doubling of its share of the U.S. market from 1 percent to 2 percent. The Reagan administration was reported to have been left with the impression that the increase would satisfy the Ozal government.

Thus Shultz expressed surprise last weekend when Ozal said he wanted the textile quota increased to $400 million.

Other countries usually are more subtle in linking trade and security. Destler cited South Korea, which frequently makes quiet use of its security concerns in trade talks without officially raising them at the bargaining table. The Koreans like to underscore their vulnerability to communist takeover, he said, by taking trade negotiators to the 38th parallel, less than an hour's drive from the capital city of Seoul, where the visitors can look across the border at communist North Korean troops.

Traditionally, security considerations provide an unstated underpinning to the United States' trade relations with Japan, serving "as a force for limiting pressure" on Tokyo to open markets, Destler said.

Reagan administration trade officials, for instance, frequently complain that their Defense Department colleagues urge restraint in Cabinet-level discussions on possible trade retaliation against Japan, arguing that stiff action might harm the security aspects of the relationship.

"Japan never makes the link directly. To the extent that it is made, it is generally made by the U.S. State and Defense departments, which tend to vote free trade on virtually all bilateral matters because of the larger relationship," said a former U.S. official who was involved in trade negotiations with Japan.

The nurturing of the "larger relationship" between the United States and its foremost Pacific ally, Japan, appears to have succeeded.

"While the media in both nations focused on bitter trade frictions, the defense alliance . . . was probably operating more smoothly than at any time in its 33-year history," reported a study by the Edwin O. Reischauer Center at Johns Hopkins University's School of Advanced International Studies.

For Japan, it appears that the trade relationship is more important. The United States seems to give greater emphasis to national security.

With Prime Minister Yasuhiro Nakasone scheduled to meet President Reagan at Camp David in two weeks, concern is surfacing on Capitol Hill and among officials in government agencies dealing with trade that major trade irritants again will be submerged to protect the larger relationship. Because of this, 53 senators -- including Majority Leader Robert J. Dole (R-Kan.) and Minority Leader Robert Byrd (D-W.Va.) -- wrote Reagan last week to urge him to make trade a primary focus of his meetings with Nakasone.

This submerging of trade to national security and other diplomatic concerns is the major reason Congress took trade negotiations from the State Department and created the Office of the U.S. Trade Representative in the White House, said Robert E. Herzstein, a former undersecretary of Commerce who now is a trade specialist with the Washington law firm of Arnold & Porter.

For the United States, trade is used as an instrument of foreign policy most frequently in the imposition of export controls against countries, usually in the East Bloc, as a way of signaling displeasure. Other countries do things differently: They refuse to buy instead of putting restrictions on sales.

France, for instance, is boycotting New Zealand lamb until that country frees French secret agents who were convicted of blowing up an antinuclear-protest vessel.

New Zealand feared the United States would react the same way to its refusal to allow Navy ships in its ports if they carried nuclear weapons. Political relations between Washington and Wellington turned frosty, but the trade links remained unaffected.