The British ambassador to the Netherlands and his Dutch doorman were shot to death just outside the ambassador's residence in The Hague this morning in what sources here believe was a terrorist attack by the Irish Republican Army.

The ambassador, Sir Richard Sykes, was entering his silver Rolls Royce limousine, with 19-year-old Karel Straub closing the door, when they were both shot by gunmen firing from a small square behind a church opposite the ambassador's residence.

Sykes, 58, was the author of an important government report several years ago recommending increased security precautions for British diplomats abroad, particularly around ambassadors' residences.

Slumped in the back seat of the car, he was rushed by his uninjured chauffeur, Jack Wilson, down the narrow street to Westeinde Hospital only a few hundred yards away. But the ambassador died at the hospital two hours later. Straub, who was taken to the hospital by ambulance, also died there.

Dutch police said the attack was carried out with well trained precision. Only four shots, one of which hit Sykes in the head, were fired from about 10 yards by two gunmen wearing business suits who escaped on foot in rush-hour traffic. A search of the center of the Dutch capital, where the shooting took place, and roadblocks around its periphery had not turned up any suspects by tonight.

The ambassador's secretary, who was sitting next to Sykes in the back of the limousine, was not hit. Accounts of the shooting taken from her and bystanders on the busy street contitute the only known evidence the police have for their investigation.

No group claimed responsibility for the killing. But sources here said that if Sykes was murdered by terrorists, they would not be expected to announce their responsibility until the gunmen had reached safety.

Speculation here that IRA terrorists may be responsible for the attack was based on last year's IRA bombings of British NATO bases in Germany and the fact that Sykes authored the security report.

Sykes had been sent by the British government to Dublin in 1976 to investigate the murder there of the British ambassador to Ireland, Christopher Ewart-Biggs, who was killed by the explosion of a land mine under his car just outside his residence. The IRA had claimed responsibility for his death.

Sykes, who was working at the time in the British Foreign Office here after having served as deputy to the British ambassador in Washington, concluded that security needed to be tightened, particularly in Ireland.

Security was reported to have been improved at British embassies and residences in Europe after the IRA bombings of British military targets there began. Officials here have feared that IRA terrorists may find it easier to hit British targets in Europe and escape back to Ireland than to make their way through stringent border controls in Britain.

Although some of the extra security for British embassies was to have been provided by local police, Dutch police officials said there were no policemen on duty outside Sykes' residence when the gunmen attacked at 9 a.m. today. They said the embassy had not requested any guards.

In 1977, the British consul-general in Marseilles escaped injury when a letter bomb sent to his office was defused by French explosive experts. In 1973, one of a number of letter bombs sent to British embassies in Europe and Africa exploded in the embassy in Washington, blowing off a secretary's hand.

In Parliament here today, the opposition spokesman for foreign affairs, Francis Pym, called for further improvements in security for British diplomats. Foreign Secretary David Owen, who condemned the "appalling and premeditated" murder in The Hague, said security arrangements were constantly being reviewed.

"When all is said and done," Owen added, "if people are to conduct themselves in public life openly and in a civilized manner, some risk will always be attached."

Sykes, who also was ambassador to Cuba in the early 1970s, became ambassador to the Netherlands in 1977.