The votes of just one or two members of Parliament will decide Wednesday whether James Callaghan becomes the first British prime minister in 55 years to have his government brought down by a vote of no confidence.

Callaghan today won the conditional support of three Welsh nationalist members of Parliament, leaving his Labor Party government just two votes short of surviving the challenge of the opposition Conservatives and their leader, Margaret Thatcher.

The outcome now is in the hands of seven Protestant Ulster Unionist members from Northern Ireland, who were instructed by their leaders today to Vote against the Labor government because it had not restored home rule to their strife-torn province.

One of the seven Ulster Unionists has said he will vote for Callanghan anyway. But if the other six vote against him, Callanghan would have only 312 sure votes against the 314 Thatcher expects from the Conservatives, the Ulster Unionists and two other parties, the Liberals and the Scottish Nationalists.

If Callaghan's government is brought down, a national election would be held at the end of April or the beginning of May. Callaghan had wanted to wait until October, near the end of Labor's five-year term, because he and his party currently are far behind Thatcher and the Conservatives in public opinion polls.

Callaghan's hopes of avoiding the first government censure in Parliament since Ramsat MacDonald, the first Labor Party prime minister, was brought down by a no-confidence vote in 1924, were brightened somewhat today by the Welsh nationalists.

They announced that they would vote for the Labor government if it continued its last-minute efforts to rush through Parliament a bill providing millions of dollars in compensation for Welsh slate quarry miners suffering from lung diseases. The bill was hurriedly introduced today even though its final draft had not been completed, and the government promised that it would be passed by May.

One of three Welsh members, Dafydd Wigley, said he would have to vote for the government even though he had "contempt" for its "cynicism" in moving on the bill only now when it needs the Welsh nationalists' votes on Wednesday.

"I personally could not sleep at night," Wigley said, "if I thought I had been responsible for preventing a bill" for the ailing miners.

Callaghan, who was in a combative mood today on his 67th birthday, told jeering Conservatives in a boisterous House of Commons that he was angry about being accused of buying the Welsh nationalists' votes with the lung disease compensation bill, which he said would benefit similarly afflicted workers throughout Britain.

"Whatever may be the desire of the Tories or some minor parties to claim that something has been done in order to gain votes," Callaghan said, "that is a total misrePresentation of the sequence of events."

He uncharacteristically lashed out at the press for broadcasting that "misrepresentation" to the country and accused some reporters of being the Conservative Party's "lap dogs."

Last week, some of the Ulster Unionists had sought unsuccessfully to trade their vote for an expensive natural gas pipeline to be built under the Irish Sea to Northern Ireland and a return of home rule to Ulster.

Although the six undeclared Ulster Unionists are nominally led by the party officials in Northern Ireland who told them today to vote against the government, they have been heavyily influenced in Parliament by one of their number, the unPredictable Enoch Powell.

Powell was a Conservative Party Cabinet minister until 1968, when he was banished to the back benches after launching a campaign against immigration of blacks and Asians from the Commonwealth.He then gave up the English Midlands seat in Parliament he had held for 24 years and urged his constituents to vote for the Labor Party, which they did. Five years ago, he won a seat from Northern Ireland as an Ulster Unionist, despite charges of being a carpetbagger.

Powell's silence on his voting intention Wednesday has focused attention on him as a possibly pivotal figure in the confidence vote. This has raised Powell's political profile once again and put his picture back on front pages just three weeks after he reasserted his racial views in a speech declaring that "alien occupation and control" of London and other British cities by nonwhite immigrants "is already a fact."