Former Massachusetts governor Edward J. King, a conservative Democrat who backed President Reagan's reelection bid, switched to the Republican Party yesterday, setting the stage for an expected bid to recapture the governorship.

King, once described as Reagan's favorite Democratic governor, is at least the fourth person nationwide who has switched from Democrat to Republican and is considering a run next year for a governorship.

The others are former representative Kent R. Hance of Texas, William Lucas, the executive of Wayne County, Mich., and Bob Martinez, mayor of Tampa, Fla.

A pro-business politician, King won the Massachusetts governorship in 1978 over incumbent Michael S. Dukakis in one of the most bitter primary fights in recent state history. Yesterday he indicated an interest in the governorship, but did not declare his candidacy.

King, who supported Reagan's budget and tax cuts, lost to Dukakis in the 1982 Democratic primary in a defeat seen as a rejection of the economic policies of the Reagan administration. The nation was in a recession that year and the unemployment rate was slightly more than 10 percent.

King, 59, who registered his switch of political parties at 8 a.m. at the town clerk's office in his hometown of Winthrop, told reporters:

"The truth is simply that the Democratic Party has ceased to be the party of the sensible center and has become a party dominated by professional liberals. Today the Republican Party, rather than the Democratic Party, can and will be the party of the sensible center."

If King had remained a Democrat, he might have been unable to qualify to run against Dukakis in the 1986 primary. He would have needed the support of15 percent of delegates to the Democratic state convention, and most are considered Dukakis loyalists.

Dukakis refused to comment on the switch, saying, "Next year is plenty of time for politics."

Rep. Chester G. Atkins (D-Mass.), the Massachusetts Democratic Party chairman, told a news conference in Boston that King's reasons for changing parties are "self-serving and opportunistic."

At the White House, spokesman Larry Speakes said: "We welcome Governor King to the Republican Party . . . . It is particularly noteworthy that this latest switch comes from a state that has been known particularly as a Democratic stronghold."