As Afghanistan's guerrilla war between Moslem rebels and the Soviet-backed goverment creeps closer to the capital, Kabul, most Western diplomatic missions there have prepared emergency evacuation plans.

Most major roads in Afghanistan are now considered unsafe because of the fighting, and Kabul's airport is believed likely to come under attack if the rebels launch an assault on the capital.

No Western ccasualtieshave been reported so far because of guerrilla action on the roads, but the United States now is warning tourists to stay away from Afghanistan.

The United States has evacuated some of its 100 "nonessential" embassy personnel and their families. When this phase of the evacuation is complete, the U.S. Embassy will be left with a skeleton staff of 48.

The American decision to be first out is regarded synpathetically by other Western diplomats, some of whom feel that unless the situation improves quickly, they may not be far behind.

The extra caution being shown by the United States is seen as a result of its recent experiences in the region -the killing in February of the American ambassador to Kabul, Adolph Dubs, after armed terrorists kidnaped him, and the capture of the U.S. Embassy in neighboring Iran by revolutionaries the same day.

The situation in Kabul is becoming increasingly tense. Western sources say there has been no sudden deterioration, but that the continuing guerrilla war has taken its toll. Near the city center, occasional machine-gun fire can be heard from the outskirts as the war moves closer.

The only road available to Westerners out of the country- -to Pakistan via the Khyber Pass- -has been cut sporadically by guerrillas.

The vital road link to the Soviet Union is also under threat, particularly at a point about 36 miles north of Kabul, and Western sources say this pattern is repeated elsewhere.

Moslem guerrilas are reported to have captured considerable quantities of government weapons. The sources say they are now better armed and have some artillery, antiaircraft guns and stocks of ammunition.

Desertions from the Afghan armed forces are also said to be continuing at a high rate. According to some reports, some troops have killed their officers and gone to the rebel side with their weapons.

"The total picture is one of a gradual wearing down of the government's ability to cope with insurgency," one source siad. The government is formed "to commit too many of its reserve elements to the urban centers to be able to contain fighting in the countryside."

A recent Afghan Cabinet reshuffle is seen by Western sources as a new attempt to deal with the problem. The prime minister, Hafizullah Amin, has relinquished the portfolio of foreign affairs and has become acting as allowing Amin -- one of the strongmen of the 14-month-old government - to pay a more direct role in countering the insurgency.

However, there is no evidence to suggest that President Nur Mohammed Taraki's government is also moving to create a broader political front in an attempt to bolster its popularity. The overthrow of President Mohammed Daoud in a bloody coup in April, 1978 was carried out by a small group that had no popular base within the country. It has stayed in power thanks largely to widespread purges in the armed forces and the administration, and to substantial Soviet backing.

As the war comes closer to Kabul and the long-term survival of the Taraki government seems less certain, the Soviets are believed to be casting around for an alternative that might allow them to maintain their foothold in Afghanistan.

It is not an easy task. The rival Communist leaders, purged by Taraki last year and exiled to Eastern Europe, are possible replacements, but their presence will not end the guerrilla war.

The rebels themselves lack unity, too. Although they are Moslems and consider themselves fighting a holy war, they are divided not only by set, but by the tribe. Also, Afghanistan does not have a single leader to whom the guerrilla forces owe allegiance.

Some diplomats say the worst thing that could happen to Afghanistan at the moment would be for the rebels to suceed in overthrowing Taraki.

Leaving aside the Soviet reaction, they fear the result would be rival guerilla groups contending for power, an eruption of religious differences and a total breakdown of law and order. CAPTION: Map, no caption, By Richard Furno- -The Washington Post