Maj. Gen. Ziaur Rahman, the infantry officer whose military regime has ruled Bangladesh since a coup three years ago, appeared headed for an impressive victory yesterday in the country's first presidential election.

Partial returns showed Zia enjoying a lead of around 4-to-1 over his nearest rival, Maj. Gen. Ataul Ghani Osmani. About half of the country's 38 million voters appear to have turned out on a day generally free from monsoon storms which, it was feared, might have disrupted polling.

[Election commission sources said the turnout was very large and predicted Zia would win with 70 to 80 per cent of the vote, UPI reported.]

Osmani's party immediately cried foul about the returns, alleging "stunning" irregularities in the polling, including the forcible ejection of party agents at gunpoint, the stuffing of ballot boxes and mass intimidation of voters. The Bangladesh chief election commissioner, Oazi Jalal Ahmed, said, however, that he had received no formal complaints. He said that, "as far as I am concerned this election has been a fair fight."

Western reporters who toured polling stations, both in Dacca and the surrounding countryside, found no firm evidence of improper activity.

If Zia, 43, and his six-party Coalition National Front wins, it seems likely that promised parliamentary elections will be held here in December. It thus seems possible that after three years of rigid and repressive military rule, Bangladesh may soon enjoy a rarity in recent local history, a return to ciilian democracy of a sort. Western observers are not sure that this will necessarily lead to stability and prosperity for Bangladesh but, as one diplomat put it, "It will send the soldiers back to their barracks somewhere, at least."

The question of most immediate importance, which will be decided later this weekend, is whether the chastened opposition alliance will accept yesterday's voting figures as a true representation of popular will or whether, as in Pakistan 18 months ago, they will take to the streets in protest. Osmani, 60, an infantry officer propelled to the head of the alliance dominated by the popular Awami League Party, which ruled this country for its first four years, hinted last night that he might refuse to accept the verdict.

"If I were to have been kicked out by a fair boot," he said, using characteristically antiquated British phraseology, "I would have accepted it as being the will of the people.But the reports from my agents tonight suggest there has been massive rigging. Our member parties (there are seven) will have to meet tomorrow to decide our strategy."

According to Osmani's colleagues, some 200 complaints of election malpractice were filed during the eight hours of polling yesterday.

Reporters touring some of the country's 21,000 polling stations to check out the allegations found little to substantiate the claims. True, political agents working for Osmani were not present at some booths. They were said by local officials to have "gone for lunch" or to have "lost interest." There were also reports of voters arriving at the polling stations to find, in the words of one astonished high court judge, that, "I see I have voted already." Generally, however, Ahmed's assertion that all had been conducted as fairly as is humanly possible" appeared correct.

Some initial results, telephoned in to Dacca 40 minutes after the polls closed, tended to strain credibility. One village had 1,496 people voting for Zia, and just two voting for Osmani. The town of Bogra, Zia's home town had more than 5,200 for the local favorite an just six for Osmani.

"But I do believe those figures," the election commissioner said. "I live here. I know just how popular Zia is and how little known Gen. Osmani was."

Zia, who campaigned hard under the election symbol of a sheaf of rice, claimed that under his regime Bangladesh enjoyed unparalleled stability and unity. Osmani campaigned principally on his contention that Zia does not intend to return the country to a British-style parliamentary democracy, but will instead run it along continental European lines with a supreme presidency.

Osmani appears to have suffered principally from being a relatively unknown despite his role as a "freedom fighter" in the 1971 "liberation war" that separated Bangladesh from the Union of Pakistan. He has also suffered from his association with the Awami League, a party that, while once held in high esteem during the days of Sheikh Mujibur Rahman, is now widely seen as a party of corruption, nepotism and ineffiency. The Awami League remains the largest party in the country. It seems to have organized this campaign for Osmani very badly indeed, however.

The election turnout has not been impressive by the usual standards of this part of the world. Observers put this down generally to the fact that farmers are presently busy in their fields bringing in another rice harvest, drying recently gathered red peppers and cutting jute. The total turnout is expected to be about 20 million, an impressive enough mandate, if a true one, for President Zia to begin a program of ambitious reforms.

Whether he will end martial law (there is still curfew in Dacca every night), relax curbs on left wing political parties and release the thousands of political prisoners still held there remains to be seen.