Prime Minister Margaret Thatcher today selected a carefully balanced Cabinet, dominated by close allies from her four years as opposition leader, to carry out the new Conservative government's mandate for change in Britain.

As expected, she named her two conservation economic advisers, Geoffrey Howe and Keith Joseph, to the key posts of chancellor of the Exchequer and industry secretary to stop the drift of Britian's mixed economy toward socialism.

As chancellor of the Exchequer, Howe, 52, will run the treasury, making the cuts in taxes and government spending that Thatcher made her central campaign promise, and try to hold the tight reins on the money supply and government cash flow that the Conservatives believe can control inflation.

Joseph, 61, a right-wing intellectual credited with being Thatcher's economic mentor, will continue to advise her closely while working to reduce government ownership of industry.

While putting all of her other staunch allies from the Conservative Party's right wing into Cabinet or sub-Cabinet posts. Thatcher also chose several party liberals once closely identified with the man she ousted as party leader, former prime minister Edward Heath.

Thatcher appointed one of them, stylish aristocrat Lord Peter Carrington, as her foreign secretary; another, farm owner James Prior, as employment secretary to deal with the unions, and a third, stockbroker Peter Walker, as minister of agriculture, fisheries and food, a key post in this Common Market country.

She also appointed diplomatic moderate William Whitelaw, 61, who has been as loyal to Thatcher as he was to Heath, to the important position of home secretary, in charge of noneconomic domestic policy, and deputy to the prime minister.

Conspicuous by his absence from the Cabinet was Heath. He and Thatcher had been notably cool toward each other since she replaced him as party leader and repudiated many of his policies as she moved the party to the right. Yet there had been much speculation here that he might be offered a Cabinet position to unify the Conservatives now that they are back in power.

Heath had campaigned vigorously across the country for the Conservaties, mounting the strong verbal attacks against Labor prime minister James Callaghan that Thatcher's advisers warned her not to make. Heath, however, never mentioned Thatcher during the campaign-referring to the Conservative leadership only as "they"-and did not pay public tribute to her after the election.

Thatcher aides made it known today that she believed she had to give a former prime minister either one of the three or four top positions in the Cabinet or none at all, and she could not find room for him at the top.

Carrington's experience internationally and as defense and energy secretary in the Heath government prevailed over Francis Pym, 59, a recently risen star in the party and campaign foreign policy spokesman whom Thatcher made defense secretary instead.

Prior, 51, is an engaging, easy talker who has been patiently consulting union members for the last five years about the changes the Conservatives want to make to curb union power. If Prior had not been included in the Cabinet, it would have been seen by union leaders as a signal that conflict with the Thatcher government was inevitable.

In trying to change the course of Britain after the government had been controlled by the democratic socialist Labor Party for 12 of the last 15 years, the team that Thatcher has assembled now will face a number of important challenges.

The Thatcher government is committed as its first priority to cut income taxes and government spending to encourage individual initiative and revitalize private enterprise.

Howe's first budget, which will show the extent of the Conservatives' intended changes, is expected to cut the basic income tax rate from 33 to 30 percent, lower the maximum rate for high incomes from 83 percent-one of the world's highest-to 60 or 65 percent, and increase personal exemptions.

To recoup some of the lost revenue and begin a shift of the tax burden from direct taxes on earnings to indirect taxes on consumer spending, the value-added tax hidden in the prices of some goods here will be raised.

The Conservatives also hope to save money by not replacing all of the 8 to 12 percent of the government's work force lost through attrition each year and by trimming fat from the bureaucracy, although some of that was done by the Labor government at the insistence of the International Monetary Fund.

Perhaps the biggest problem facing Howe is large pay raises promised or still being negotiated with several million government workers.

Howe's brightest hope in the long run is the expected steady growth of government revenue from North Sea oil, which will begin reaching peak levels about 1982.

Thatcher is committed to stopping the growth of Britain's powtwar welfare state and reducing the government's role in the economy. No more industries will be nationlized and the government's speculative investment in new high-technology industries is to be stopped.

All or part of the government's present ownership of many major firms-including British Airways, the British National Oil Corp., and even British Petroleum-will eventually be offered for sale to private investors. For now, the government would keep some firms such as British Leyland and Rolls Royce, that require government investment to stay alive.

The Thatcher government also intent to reduce or eliminate unemployment compensation for people thought not to be trying hard enough to find work and for striking labor union members. It also plans to trim a layer of bureaucracy from the National Health Service and to encourage families who can afford it to pay for speedier private health care.

Thatcher and Howe have promised, however, not to cut overall spending for the National Health Service or to dismantle or reduce other basic welfare programs for the poor, elderly and disabled.

In perhaps its most divisive policy plans, the Thatcher administration intends to curb union power by prhibiting secondary picketing and boycotts, requiring secret ballots for important union decisions, including the creation of union shops.

While many Britons who voted for the Conservatives-including a large number of union members, the Conservatives claim-did so in reaction to last winter's nasty strikes, whatever Thatcher tries will face stiff opposition from powerful British unions that brough down Heath's last Conservative government.

Already union leaders have expressed their apprehension about what Thatcher will do. They also said their agreement with Callaghan to consult with the government on wages and be patient about striking in the future was so longer in force.

The potentially critical problem of Rhodesia aside, Britain's relations with the rest of the world will not change much in substance, although there will be notable differences in tone and style.

The Thatcher government is committed to continuing Britain's special relationship and close consultation with the United States.

Thatcher also wants to strengthen NATO and British military defences against what she sees as an increasing Soviet Bloc threat to Western Europe.

As opposition leader, her anti-Soviet rehetoric was quite strong at times, in contrast to Callaghan's low-key approach to East-West relations. The Soviet press responded by calling her an "iron lady" - which she defiantly exploited to her advantage during the campaign.

One of the most difficult decisions facing Thatcher is what do about her campaign promise to recognize the new biracial government of Rhodesia and end British economic sanctions if she receives a favorable report on the recent election there from her team of observers.

The report is expected to be at least conditionally favorable and there will be strong pressure to move speedily on recognition from a large element in the Conservative Party, which has been waiting anxiously for this opportunity.

It is now expected that the Thatcher government will carry on extensive consultations with the United States, its European allies and the Commonwealth nations at their August meeting in Lusaka, Zambia, which both Thatcher and Queen Elizabeth II will attend, before reaching a final decision. CAPTION: Picture 1, Chancellor of the Exchequer Geoffrey Howe, UPI; Picture 2, Foreign Minister Lord Peter Carrington, UPI; Picture 3, Secretary of Defense Francis Pym, AP