Dominicans lined up in front of supermarkets and banks yesterday, stockpiling food and money in preparation for a feared armed upheaval following today's national election.

Although there has been virtually no indication that such an upheaval will occur, the preparations are force of habit here. Few have forgotten the tumultuous years between 1961 and 1966 when warring political and military factions elected, imposed and overthrew a series of governments and brought the deaths of hundreds.

There has been an almost unearthly quiet since then under the presidency of Joaquin Balaguer. He has been elected to three successive terms over the past 12 years. In 1970 and 1974, he had little opposition, although a leading challenger withdrew claiming harassment and fraud.

This time, the opposition Dominican Revolutionary Party has waged a strong campaign and, for the first time since 1966, the outcome is in question.

Although the powerful and largely conservative military is forbidden from campaigning, and soldiers are not allowed to vote, the armed forces have made no secret of the fact that they favor Balaguer, 70, over his opponent, Antonio Guzman.

While both parties have argued issues ranging from the country's stagnant economy to the influence of the U.S. government and multinational corporations - the overriding issue has been whether Balaguer can, or should complete a fourth term.

For the past year, rumors have circulated that the aging president is in poor health and is nearly blind. In an interview yesterday, Balaguer said his health was "in God's hands" but that he was feeling fit. While he appeared frail and subdued, Balaguer seemed alert and in good humor.

The government is extremely sensitive about rumors, however. Last Saturday, United Press International correspondent Pieter Van Bennekom was detained when he arrived at the airport and deported.

While the government offered no official explanation, informed sources said the government was infuriated by a story written by another UPI reporter last week questioning the president's health and describing widespread corruption in his administration.

The incident proved embarrassing to the government, which has gone out of its way to open the election to observers and avoid any hint of fraud.

Balaquer invited the Organization of American States to send an observer mission to monitor the elections. In addition to that mission, comprised of former presidents of Guatemala, Ecuador and Colombia, the election is also being monitored by a Spanish member of Socialist International and Gregory Wolfe, a Washington activist representing Rep. Donald Fraser (D-Minn.).

Fraser last year protested what he called President Carter's "unwitting" violation of non-partisanship in the Dominican elections when the president praised Balaguer during the Dominican president's visit to Washington last September.

During that visit, Carter said Balaguer had "set an example . . . in changing his own country . . . away from a former totalitarian government to one of increasingly pure democracy." After talking with Balaguer, Carter said, he thought the Dominican election would be a "model to everyone."

Those statements were subsequently used by Balaguer's supporters as proof of U.S. government support for his candidacy and by the government itself in a slick brochure entitled "President Balaguer in Washington."

Long U.S. involvement in the Dominican Republic, including troop occupations from 1916 to 1922, and in 1965 during a civil revolt, have been made part of the campaign by the opposition party, which has accused Balaguer of collusion with the U.S. government and American Corporations here.

Fuel was added to that particular fire last month when Robert A. Hurwitch, U.S. ambassador here for the past four years, abruptly resigned.

Hurwitch, who had close ties to Balaguer, is currently under Justice Department investigation for alleged misuse of embassy funds.

Yesterday, after a number of delays Balaguer said were necessary because of campaign activity, he accepted the credentials of new U.S. ambassador Robert L. Yost.Although campaigning officially ended Sunday evening, the fact that Balaguer will be pictured with the new ambassador in election-day newspapers was lost on neither the opposition nor the embassy.

Balaguer has reminded Dominicans that his government brought peace, tranquility, and economic prosperity after a recent history that included the 30-year dictatorship of Gen. Rafael Trujillo and the chaos of the early 60s. He has subtly warned that a change may not be for the better.

Still, Balaguer said yesterday that he would accept the choice of the Dominican Republic's 2.3 million voters, and that he expected the military to do the same.