Prime Minister Margaret Thatcher of Britain and Charles Haughey of Ireland opened a dialogue today that Haughey said greatly improved relations but still left them far apart on how to solve the problem of Northern Ireland.

Haughey told Thatcher that the only "lasting solution" was the unification of British-ruled Ulster with the rest of Ireland through negotiation between London and Dublin. "In our view," Haughey told reporters after his day of talks with Thatcher here, "a solution in Northern Ireland without a new dimension between Britain and Ireland cannot be achieved."

Irish officials reportedly have in mind a package of possible future proposals to protect the interests of Ulster's Britain-descended Protestant majority in a unified, predominantly Roman Catholic Ireland. They are reliably reported to include common citizenship and voting rights for British and Irish, as well as Anglo-Irish cooperation on defense, foreign policy and constitutional questions. They would provide for changes in the Irish constitution to guarantee Ulster's regional autonomy and the Protestants' rights, including the right to divorce.

But Thatcher told Haughey (pronounced Haw-hee) for intention is to grant Northern Ireland a majority-rule regional government within Britain with political mechanisms to ensure some power for Ulster's Catholic minority. British officials hope to unveil new Ulster home-rule proposals next month.

Although Thatcher's government has the votes in Parliament to force through any Ulster home-rule plan, it faces an uphill task winning its acceptance in Ulster, where several previous attempts have been scuttled during the sectarian violence of the past decade. A 21-day conference of Protestant and Catholic political leaders in Belfast this winter also failed to produce agreement on a home-rule plan.

Thatcher reiterated the guarantee that Ulster will remain part of Britain so long as a majority there wants it to be, which Haughey later called "a very real stumbling block to political progress."

But an upbeat joint communique stated that Haughey, "while agreeing . . . that any change in the constitutional status of Northern Ireland would only come about with the consent of a majority . . . reaffirmed that it is the wish of the Irish government to secure the unity of Ireland by agreement and in peace."

Haughey emphasized afterward that the meeting with Thatcher was "friendly, cordial and constructive, one of the most successful discussions I have had with any other prime minister." Haughey and Thatcher promised to meet regularly "to develop new and closer political cooperation."

They also expressed satisfaction with recently increased cooperation in combating terrorism across the Irish-Ulster border. Haughey pointed out that "our security matches or goes beyond that of the British. Security costs us a great deal more than it costs Britain."

Some Irish and British officials have speculated that despite their governments' policy differences on Northern Ireland's future, Haughey and Thatcher are similarly agressive, conservative politicians who are relatively new on the job and could work closely with each other.

Haughey told reporters, "There is a sense of urgency in Northern Ireland and I think the British government shares this. There is a closer understanding of the urgency. The very social fabric of Northern Ireland is reaching the stage where it is in danger of deteriorating beyond repair."

British officials describe Thatcher as "determined to move ahead" with limited home rule for Ulster, which is now run almost entirely by bureaucrats from London. They hope new home-rule proposals can be discussed by Ulster and British leaders this summer and shaped into legislation by fall. They want to be ready to hold elections in Northern Ireland next year.

Ulster Catholics, backed by Dublin, oppose the return of undiluted majority rule by the Protestants, while many Protestant leaders vow to sabotage any form of home rule that gives the Catholic minority more power than its one-third strength at the ballot box.

Proposals currently being considered by British officials are based on a majority-rule Parliament for Ulster with some key powers, such as finance, concentrated in parliamentary committees with weighted voting to give Catholics a veto against the Protestant majority. In any event, Britain would retain control over security in Northern Ireland, as well as traditional national government functions.