Prime ministers Margaret Thatcher of Britain and Jack Lynch of Ireland, who are to meet here Wednesday, remained far apart today on what immediate steps should be taken to cope with the deteriorating situation in Northern Ireland.

Thatcher's government has made it known here that she wants Lynch to make several changes in Irish policy on cross-border cooperation in combating Irish Republican Army terrorism.

Heading the list are requests that Ireland allow Ulster security forces to pursue terrorist suspects across the Irish border, permit Ulster police officers to attend interrogations of terrorist suspects in Ireland, extradite suspects wanted for crimes committed in Ulster or mainland Britain, and set up direct communications between the Irish Army and British troops in Northern Ireland.

In interviews on Irish radio yesterday and BBC television today, Lynch virtually ruled out agreement on any of these measures in his meeting with Thatcher, although he said he would "look at any reasonable suggestions."

He said the meeting should concentrate instead on the need for Britain to try again to replace direct British rule in Northern Ireland with some kind of local administration in which the Protestant majority and Catholic minority would share power. The last attempt in 1974 failed when militant Protestants there called a general strike.

"I will be indicating to Mrs. Thatcher that there is need now, four or five months after her succession to government, for contemplating a political initiative," Lynch said. "Unless we can produce a situation in which the community in the north can give allegiance to a formal administration, then this kind of violence will continue. It is a question of getting at the cause of the matter not the effect."

But Thatcher and her Northern Ireland secretary, Humphrey Atkins, contend they must continue slowly sounding out Protestant and Catholic leaders before making any new proposals especially in the emotional aftermath of last Monday's assassination of Lord Mountbatten and the killing of 18 British soldiers in Ulster by IRA terrorists. Instead, they contend, they must show progress toward improving security against accelerating more sophisticated IRA attacks on British and Ulster security forces and officials.

Lynch, whose popularity is sagging in Ireland because of recent economic and labor problems, is under political pressure to avoid appearing to be bullied or called on the carpet by the British and to show progress toward a political solution to the Ulster problem.

He had originally asked for a meeting for this purpose with Thatcher this autumn. After last Monday's violence, Thatcher asked to move up the meeting to discuss border security against the terrorists. The two now are scheduled to meet after the state funeral in London Wednesday for Lord Mountbatten.

Lynch and Irish officials contend there is already close cooperation between Irish and Ulster police on terrorist investigations and that they serve adequately as the channel for communications between the armies that carry out antiterrorist pa-rols on either side of the border.

It would violate Ireland's sovereignty to allow "hot pursuit" across the border by Ulster police or British troops, they contend, and would violate the Irish constitution to allow the extradition to Ulster or anywhere else of anyone who can show in court that they are being sought for politically motivated crimes.

They pointed out that Ireland's six-year-old emergency antiterrorism law has been used to arrest, prosecute and imprison many IRA terrorists in Ireland. The law also authorizes trials in Ireland for suspects charged with crimes in Ulster or the rest of Britain. But Ulster police police say they cannot gather sufficient evidence for the arrest of these suspects without questioning those have taken refuge in Ireland.

"We have the strongest code of law against terrorists of any country in Western Europe," Lynch said.

Meanwhile today, the flag-covered coffin containing Lord Mountbatten's body was moved from his Broadlands estate in the Hampshire hills southeast of here to the 12th century abbey at nearby Romsey, where he and his family had worshipped.

Lord Mountbatten's body will be brought here Tuesday to St. James's Palace where it will again lie in state overnight until Wednesday morning's funeral at Westminster Abbey.

Averell Harriman, who was ambassador to Britain in 1946, will represent President Carter at the funeral. Pope John Paul II is sending a representative, Archbishop Bruno Heim, the apostolic delegate here. The pope took this unprecedented step for a funeral of someone other than a head of state, the Vatican said today, to "show the strength of the pope's sympathy with the mourning of the British people and express again his revulsion against acts of terrorism."

Irish and Ulster police have been cooperating closely in their investigations of the Mountbatten assassination near the Ulster border in northwestern Ireland last Monday and the bomb blasts five hours later that killed 18 British soldiers at Warrenpoint just yards from the Irish border in southeastern Ulster.

Ulster detectives have crossed the border to examine fragments of Lord Mountbatten's boat at a police laboratory in Dublin and to search for clues across the Irish border near Warrenpoint, while Irish detectives viewed the bombing scene inside Ulster.

Ulster police also supplied Irish detectives with names of possible suspects they believe were living in Ireland. Irish police rounded up 200 known IRA sympathizers last week, questioning and releasing most of them over the weekend. They are still questioning at least four men intensively in connection with the Warrenpoint bombings.