Britain's civil servants today began a crucial battle against Prime Minister Margaret Thatcher over higher pay with a one-day national strike that closed everything from government offices, defense factories and naval dockyards to dockyards to airports and museums.

Cabinet ministers and official visitors, including Soviet Ambassador Victor Popov, delivering a message to Thatcher from Soviet President Leonid Brezhnev, had to cross picket lines around government buildings and Downing Street, were the prime minister lives and works.

Leaders of an unprecedented alliance of nine unions representing more than 500,000 national government employes -- from clerks and typists to the elite civil service "mandarins" who run the bureaucracy -- said the shutdown will be followed by continuous disruptions in vital government functions. Strikes by small groups of key workers, mostly at computer centers, are planned for Thursday to stop or slow down tax collecting, customs and immigration and military communications.

"We hope to blow the government's economic strategy right off course," said William Kendall, general secretary of the umbrella Council of Civil Service Unions.

For Thatcher, the confrontation represents a critical test of her anti-inflation policies. With inflation falling steadily and unemployment rising rapidly, local government employes and teachers, as well as workers in much of private industry, have settled for pay rises under 10 percent during this winter's wage negotiations, far below last year's average of about 20 percent.

The civil servants have demanded a 15-percent pay rise and reinstatement of a system, which Thatcher suspended, for matching their pay levels to those in private industry. Thatcher's government has answered that it cannot afford anything more than a 7 percent wage increase during Britain's severe recession.

By both union and government estimates, about three-fourths of the civil servants stayed off their jobs, leaving only some central offices in London with big staffs. Regional offices, unemployment and social security centers, ordnance factories and naval dockyards were empty. Major airports, including Heathrow outside London, were shut. Many courts were closed.

Tourists found museums shut and the Tower of London was locked up by the resident Beefeater guards, who also were on strike.

The disabling selective strikes the civil service unions plan next will involve relatively few workers because of the government's dependence on computers. A strike by 260 employes of one computer center is designed to stop collection of more than $800 million a week in value-added sales tax.

Despite Thatcher's policy, the government has agreed to a 13 percent increase for miners and water workers. When threatened last month with a national miners' strike like the one that brought down the last Conservative government in 1974, Thatcher also backed away from an attempt to close down 23 money-losing coal mines, which would have put 13,000 more miners out of work.

Partly a result, she is under political pressure to draw the line with the civil servants. Opinion polls show that once-widespread public respect for them has given way during hard economic times to resentment of their protected jobs, index-linked pensions and recent pay increases.

The civil servants also plan actions such as a strike by 300 operators of Defense Ministry computers that could keep vital munition supply depots and naval dockyards closed. Disrupts by civilian workers in military intelligence and communications centers are expected to curtail allied surveillance of airwaves over the Atlantic and to affect British participation in Operation Wintex, the biannual allied simulation of preparations for war with the Soviet Union, which began this week.

The civil service unions, which have amassed a strike fund of about $7 million, plan to spend more than $500,000 a week reimbursing these striking workers for most of their lost salaries.

British civil servants earn from under $10,000 a year at the lowest levels to more than $60,000 at the top, which is $10,000 more than the prime minister's salary. Despite large raises in recent years, about three-forths of the government workers still earn less than what study commissions say are the salaries of comparable employes in private business.

Thatcher has scrapped a long-standing pay comparability system designed to close this gap. She also suppressed its most recent recommendations for wage increases. Officials have said the government would agree to a new system if it were more flexible in its comparisons to private business and took into consideration each civil servant's performance and productivity.