PESHAWAR, Pakistan, Nov. 15— Pakistan has restricted the movements of Afghans living in refugee camps and has advised refugees in the cities to stay indoors until the national and provincial elections end on Saturday, refugee officials said today.

Pakistani officials have expressed concern that the presence of Afghans near polling places might touch off anti-Afghan demonstrations and accusations of vote-rigging.

''For security reasons it would be in the refugees' interest to behave like foreigners and stay away,'' said Shah Zaman, Deputy Commissioner for Refugees in Peshawar. ''There are parties that will exploit them if they come out.''

Mr. Zaman said demonstrations could turn violent because Pakistanis and the refugees have access to arms.

About 3.3 million Afghan refugees live in Pakistan, and more than 2 million of them live in the North-West Frontier Province. About 100,000 live in its capital, Peshawar. Police Checkpoints

Until Monday, refugees were allowed to move freely, and Afghans have run businesses in the cities as well as in the refugee camps. Bus services to the camps have been temporarily discontinued, and police checkpoints have been set up in Peshawar. Relief agencies in Peshawar have advised their Afghan employees to stay home and have run on skeleton staffs.

Pakistanis are to vote on Wednesday for a National Assembly, which will select a Prime Minister. On Saturday, they are to vote for provincial assemblies.

The Afghans see the elections as a turning point. They worry that their efforts to oust the Soviets from Afghanistan will receive tepid support from a new government. Some believe that if Benazir Bhutto's Pakistan People's Party wins a majority in the National Assembly, Pakistan will adhere to a much stricter interpretation of the Geneva accords, perhaps limiting arms supplies to the Afghan guerrillas and restricting refugees. 'Refugees Are Scared'

''The refugees are scared,'' a relief worker in Peshawar said. ''They hate Benazir. They remember that when Zia was alive she was more than willing to say nasty things about his handling of the Afghan issue. Zia was morally committed to the refugee cause, and they know no one else who is.''

President Mohammad Zia ul-Haq, who was killed in a plane crash in August, was a strong backer of the Afghan guerrillas.

''I don't think there will be any general changes on the official stance of the future government,'' said Said Naim Majrooh, editor of the Afghan Information Center bulletin, a monthly publication on the war.

''But they might insist that the Geneva accords be strictly implemented,'' he said. ''That might affect the distribution of arms. Even if every one of the three million refugees voted, they wouldn't change the result of the elections. All they would do is create problems.'' 'Too Late to Stop'

Abdul Haq, one of the major commanders in Afghanistan, was skeptical that the immediate effect of the Pakistani elections would be to end the Afghan war. ''Now it is too late to stop the war,'' he said. ''They might try but it won't work.''

Pakistani officials say they are worried that they will be unable to control the flow of refugees to Peshawar. Heavy fighting in Nangarhar, an eastern Afghan province, has recently brought with it a new wave of Afghans seeking refuge in Pakistan. Officials estimate that as many as 10,000 people have crossed the border this month.

''There is so much talk about the so-called refugee repatriation, but since the Geneva accords only 93 families comprising 600 people have gone back,'' said Said Ahmad Akhtar, a commissioner for Afghan refugees in Peshawar. ''The Peshawar area is so congested that we have stopped registering refugees.''

In Peshawar, the streets are festooned with flags and banners of the various parties, but the streets are quiet. All the electioneering ended on Monday, and no public rally or procession may be held until the start of the voting.

University Town, the area of Peshawar where the relief agencies and Afghan political parties are located, was quiet. The only visible Afghan presence was outside the hospitals, where groups of wounded guerrillas sat and chatted on makeshift cement terraces or in the nearby children's playground, enjoying the late autumn sunlight. A CALL FOR UNITY

ISLAMABAD, Pakistan, Nov. 15 (Special to The New York Times) -The Acting President, Ghulam Ishaq Khan, asked the nation today to accept the will of the majority after the elections, which begin on Wednesday.

He warned that ''no defeated elements'' would be allowed to try to change the verdict of the voters with a show of strength on the streets.

''It just cannot happen,'' he said. Troops and the police have been deployed across the country in anticipation of the election.

photo of Pakistanis crowding an identification-card distribution center in Lahore (Agence France-Presse); map of Pakistan