Sudan's President Jaafar Nimeri has fired his entire Cabinet, devalued the Sudanese pound and sharply reduced food subsidies, as he submitted to harsh economic measures such as those prescribed for Third World countries by the Reagan administration.

The economic changes, announced Monday night, could lead to political unrest in this East African country, which has become an increasingly important element in U.S. global strategy since the assassination of Egyptian leader Anwar Sadat. The measures are part of the terms set by the International Monetary Fund for Sudan to receive about $230 million in IMF assistance.

The United States, however, is expected to heed the politics of the situation and bend some of its self-reliance rhetoric to keep the shaky Sudanese economy afloat with increased bilateral aid to Khartoum.

"Aid is a great shell game," a Western diplomat said during an interview recently in Khartoum. "The IMF is taking with one hand under a U.S. policy while the United States is giving with the other."

President Reagan has urged Third World nations to lessen their reliance on aid programs and instead use "the magic of the marketplace" to boost free-enterprise economies. Sudan already receives more U.S. assistance than any other nation in black Africa -- $215 million in economic and military aid -- but diplomats and private financial sources expect the amount to increase.

Nimeri's military government has been the target of countless coup attempts since it took power in 1969. Two years ago there were serious riots in Khartoum after food price increases.

"At any given time you could take a small economic measure and spark something," a diplomat said.

Nimeri's announcement that subsidies on petroleum and cooking oil will be ended immediately and that those on sugar and wheat will be phased out could be just that spark.

Sugar, consumed in vast quantities by Sudanese, now costs less than 10 cents a pound. Without the subsidy it will be 30 cents a pound. That price probably will be driven higher by the 12.5 percent devaluation ordered by Nimeri, since some sugar is imported.

The impact of the devaluation on the price of wheat, the food of the urban middle class, will be even greater since most grain is imported.

Nimeri has ordered his ministers to remain in their positions until a new government can be formed, so the effect of the Cabinet shake-up may take some time to determine.

"The IMF plan will help the Sudanese in the long run if they can survive the cure," said Joe Gunn, a Washington-based economist whose work in Khartoum involves foreign aid programs. The purpose of cutting subsidies and devaluation is to reduce the country's 40 percent inflation rate and huge balance-of-payments deficit.

One of the main ways for the United States to help Sudan survive the cure would be to expand food aid, already at $37 million a year, in effect replacing with U.S. aid the reductions in food subsidies from the Sudanese government.

"With the increased political interest in Sudan, it would be a reasonable line of speculation to expect increased U.S. aid" to Khartoum, a U.S. source said.

The Reagan administration, Gunn said, "is likely to abrogate its policy" of toughening up on aid on a case-by-case basis.

He cited Jamaica, which is swinging back toward capitalism after an experiment in socialism, and Sudan as two examples of countries likely to become exceptions to aid reductions. On the other hand, Tanzania, with similar economic problems but a socialist ideology and little strategic importance, is a prime candidate for curtailed aid.

At a news conference late last month, Nimeri spoke frankly about his country's need for additional aid, saying, "we are always expecting" more aid. "We've got very good friends in the United States and the Western countries."

Sudan is familiar with the politics of foreign aid. The country's situation of being one of the world's poorest nations, combined with its strategic location controlling the waters of the Nile, has made it a favorite of Western and Arab donors.

The country has little to show for past aid, and it remains to be seen just how much the United States can bolster Sudan's economy.

"You have to go back a long way to find financial stability in Sudan," a Western diplomat said. "Things started going wrong in 1978-79 -- when agricultural exports slipped badly, oil prices went up and the country was burdened with the cost of numerous expensive, poorly planned development projects."

Today Sudan is broke. Despite half a billion dollars in IMF support funds in the last two years, the country still has a foreign debt of $1.3 billion. Output of cotton, the major export, has declined by almost 50 percent in the last decade.

A burgeoning government bureaucracy seems to be out of control. Civil service wage bills account for more than half of budget expenditures.

Given the economic problems, there is a serious brain drain, mainly to the oil-rich Persian Gulf nations. More than 1 million Sudanese, in a nation with a population of only 17 million, are working abroad.

"The troubling thing is they're producing less and living more and more on foreign loans," an economist said.

A U.S. government economic study predicts that "Sudan will experience serious difficulties throughout the decade of the 1980s."

The main economic reason for Western investment is that even though the country is currently "an economic basket case, it could be quite valuable in the long term because it has vast amounts of land and water" for agricultural purposes, another diplomat said in Khartoum recently.