Britain's ruling Labor Party won two special parliamentary elections Friday which appear to have given a strong endorsement to Prime Minister James Callaghan's incomes policy, the British version of pay increase guidelines.

At by-elections Thursday in two very different parts of the country, Labor held one seat the Conservative Party expected to win and crushed the Tories in the other, a classic, socialist mining district.

The results should make Callaghan a favorite to win the next general election, which probably will be held, in the spring. They are a sharp warning to Margaret Thatcher, the Tory leader, to accelerate her move from the right to the center of the political spectrum.

The most surprising outcome came in Berwick and East Lothian, on the Scottish border with England. This is a well-to-do, largely rural area, with a substantial farming and fishing as wekk as manufacturing population.

It is anything but a typical Labor seat.However, John MacKintosh, an able and attractive university professor, had held it for the government until his death earlier this year. The Conservative candidate, Margaret Marshali, a determined lady in the Thatcher mod, had every reason to believe she would win it back. But Labor's man, John Homes Robertson, a farmer, not only beat her but bettered MacKintosh's margin by a few hundred votes.

The government was not surprised to hold pontefract, a Yorkshire mining center Labor owns. The outcome was so predictable, less than half the electorate turned out. Even so, Labor's Geoffrey Lofthouse, an examiner now on the management side of the nationalized industry, rolled up more than twice as many votes as his opponent.

Both results were indirectly forecast by a Gallup sample of the nation that ran in the Daily Telegraph. It not only showed Labor pulling ahead of the Conservatives by 47.5 percent to 42, but also that two-thirds of the country now backs Callaghan's call for a 5 percent limit on pay gains.

Even more startling, the percentage of union members favoring guidelines, 69 percent, was bigger than that for the country as a whole. This is the statistical underpinning to a spreading phenomenon here, rank and file workers repudiating union shop stewards who seek to breach the pay limit.

The Conservatives are divided over pay curbs. Important party leaders like former prime minister Edward Heath are staunch supporters, but the party's right wing is firmly opposed.Thatcher has been moving away from complete opposition to the policy, but has not yet been identified with the less rigid stance.

Labor Party is solidly for the pay curbs. The payoff came at the polls.

Britons suffered from an inflation of more than 30 percent nearly four years ago. A drop to an 8 percent inflation rate - rightly or wrongly - is credited in part to the wage guidelines policy.

By election time - Callaghan has until next October to call one - the vote here is likely to resemble a U.S. battle of personalities rather than a European struggle over issues.

It will probably center on the very different public styles of Callaghan, the seemingly safe, reliable, trustworthy uncle, against Thatcher, the assured suburban matron whose coiffure and clothes are impeccable. Differences on matters of substance may have narrowed to the vanishing point. Instead, the voters are likely to be treated to a barrage of inflammatory oratory about crime and race.

In a personal battle, Callaghan starts with a great edge. The Gallup Poll shows 56 percent are "satisfied" with his performance and this level is rising. "Satisfaction" with Thatcher hovers below 40 per cent.

Between now and any election, Callaghan must get past one vote of confidence in the House of Commons. It will take place next month after the queen's speech, usually a laundry list of proposed legislation.

He should not have too much trouble. Although he can count only on 312 votes in a Parliament of 631 ballots, the Conservatives have just 282. The other 37 come from Nationalists in Scotland and Wales, Protestants in Ulster and the fading Liberals. Callaghan needs only eight abstentions from this mixed lot to survive.