Rep. Phil Gramm, the Texas Democrat who helped lead the fight for President Reagan's economic program, has hired a leading Republican pollster in preparation for a possible switch to the Republican Party if his Democratic colleagues force him off the House Budget Committee.

Gramm has contracted with V. Lance Tarrance and Associates of Houston to assess his chances of winning reelection to Congress as a Republican or of being elected to statewide office in Texas at a later time.

Tarrance, who was the pollster for Gov. Bill Clements in his losing reelection campaign in Texas and for Gov.-elect George Deukmejian in his surprise victory in California, works almost exclusively for Republican candidates.

Gramm said today he believes the chances of losing his seat on the House Budget Committee are "50-50," but he said hiring Tarrance was not a sign he had decided to switch parties.

"I'm going to try to keep my committee seat," he said. "But I'm not going to try to keep it by compromising what I believe in or by trying to mislead anybody. If I am thrown off, I intend to come back to my district and talk to the people I represent and try to make a decision."

Some of Gramm's Democratic colleagues believe it is a foregone conclusion that the outspoken "Boll Weevil" Democrat will lose his position on the Budget Committee, which he used as a platform to cosponsor Reagan's first budget package in 1981.

Gramm told people earlier this fall he was "going to force them to kick me off so that when I switch parties, I'll get more publicity," according to one House Democrat.

Since the Nov. 2 election, Gramm has been less flamboyant about his future, in part because Republicans took such a drubbing in Texas. Clements, who spent more than $12 million, lost his reelection bid to Democratic Attorney General Mark A. White. In addition, Republicans failed to pick up any new congressional seats here.

"Gramm may be having second thoughts," said one House Democrat.

But there is a feeling that Gramm is preparing to fight for his seat to make himself look like a martyr if he is thrown off the committee, an action that could come early next year.

House Democratic leaders reportedly are seeking ways to force him off without giving him a publicity bonanza if he switches parties.

Gramm is now looking at several options in Texas. One is to remain a Democrat and eventually return to teaching, although he admits that is unlikely.

A second is to run for the Senate in 1984 as a Republican. But that could pit him against Sen. John G. Tower in the GOP primary, and Gramm reportedly has told Tower he will not challenge him. If Tower decided to retire, which now seems unlikely, Gramm could have a virtually free shot at the nomination.

That would set up the possibility of a 1984 Senate race featuring Gramm as the GOP nominee and Rep. Kent R. Hance, another prominent Boll Weevil, as the Democratic nominee.

"It's not anything I'm seriously considering," Hance said today. "But it would be a fun race between Phil and me."

Gramm also could seek reelection to the House as a Republican from his current district, although the Democratic sweep in Texas this fall has made that choice more risky.

The departure of Clements opens up an unexpected option for Gramm. There is no obvious Republican candidate on the horizon to run for governor in 1986. If Gramm were able to win reelection to the House as a Republican in 1984, he could try to position himself to seek that office.

Gramm dismissed all such talk today. But asked how the recent election returns might affect his decision on whether to switch parties, he said, "If it had any impact, it probably would be positive. No one could accuse me of being an opportunist."