President Reagan yesterday approved imposition of import quotas on sugar for the first time since 1974 as a way to protect domestic growers and the U.S. Treasury from the cost of foreign competition.

White House sources said the president agreed to the emergency quota program only after instructing his Cabinet to devise an allocation formula that would spare sugar-producing nations of the Caribbean the brunt of the impact.

The quotas are expected to cost consumers as much as $1 billion a year.

Secretary of Agriculture John R. Block said last night that the move was necessary to staunch a massive flow of foreign sugar into domestic markets.

"If allowed to continue," he said, that development "could only lead to foreign sugar displacing domestic sugar on the U.S. market while domestic production flowed into the Commodity Credit Corp. . . . at the expense of U.S. taxpayers."

Under a sugar price-support program enacted by Congress last year, with the administration's reluctant approval, the government would be obligated to buy and store thousands of tons of this year's crop if it did not find a way to drive domestic prices above a fixed support level.

The quotas are designed to raise the domestic price of sugar from 18 cents a pound to 20 or 21 cents.

In a separate move, Block today is expected to announce a plan to dispose of about 1.5 billion pounds of excess cheese, butter and non-fat dry milk accumulated by the government under a dairy-price-support program costing taxpayers $1.9 billion this year. He also is to announce steps to discourage domestic dairy production.

Reagan's chief concern about sugar import quotas was that his administration might appear to be working at cross-purposes in the Caribbean, according to administration sources.

The Caribbean Basin initiative he unveiled with some fanfare earlier this year includes trade concessions that would permit most nations there to export sugar to this country duty free. Introducing a restrictive import quota a few months later would negate much of the benefit of the trade concessions.

However, if the country-by-country formula is tilted toward the Caribbean, it will be at the expense of other allies who are major exporters to the United States, including Australia, Brazil and the Philippines. This country imports about half of its sugar requirements.

The Reagan administration had hoped to avoid such difficult economic and diplomatic choices last year, when it opposed any price-support program for sugar. However, it relented as part of a political tradeoff to gain votes for its budget by "Boll Weevil" southern Democrats.

When the price-support program was adopted last December, the administration made clear that it did not expect to buy any sugar, which then seemed a reasonably safe assumption.

Since Jan. 1 a glut has driven down the world price of sugar by about one-third to about 9 cents per pound. Fees, duties and transportation costs raised the price of that sugar to 18 cents once its reached market in this country.

However, that price is considered a few pennies below the level needed to assure that farmers will not choose to sell their domestic crop to the Commodity Credit Corp. Since duties and fees are at the maximum levels allowable under various trade agreements, the only way to drive up the domestic price is through quotas.

The plan is expected to encounter opposition from various domestic concerns. The U.S. Cane Sugar Refiners' Association, which says it fears that quotas will drive up prices and lead to spot shortages, is threatening a lawsuit, claiming that it is illegal to impose quotas and import fees simultaneously.