The Maryland governor's race has been turned on its ear twice in the past two weeks as the two leading Democratic candidates selected running mates that came as a surprise to campaign insiders.

Both U.S. Rep. Parren Mitchell, who will run for lieutenant governor with Attorney General Stephen H. Sachs, and state Senate President Melvin A. Steinberg, who joined Baltimore Mayor William Donald Schaefer's ticket, had said they weren't interested in running for other elective offices. Mitchell had announced his retirement after 16 years in Congress and Steinberg had opted to retain his Senate post.

The Sachs-Mitchell and Schaefer-Steinberg tickets have thrown the state's Democrats into conflicting states of optimism and disarray.

But the recent additions have put a new face on a gubernatorial contest that had begun to look like a runaway for Schaefer, who holds a 2-to-1 lead in the polls.

The effect of the Steinberg and Mitchell choices will be felt most keenly in the Washington suburbs, where the only home-grown hopeful is a Republican, Thomas Mooney of Prince George's. Mooney's chances of success in heavily Democratic Maryland are considered slim.

Steinberg, who is Jewish and from Baltimore County, is expected to broaden the mayor's already strong support in metropolitan Baltimore, but his presence on the ticket is also likely to prove attractive in Montgomery County, some Schaefer supporters say.

Mitchell, who is black, is expected to help Sachs close the gap in the city of Baltimore, where a majority of the population is black. Black political activists in Prince George's are also hopeful that he will boost the campaigns of black candidates in that county, which voted heavily for Jesse Jackson in the 1984 presidential primary.

Mitchell's involvement is viewed as an energizing influence for underdog candidates such as Jim Proctor, a black school principal in Prince George's who is running against three incumbents for a House of Delegates seat.

"I met with a group of postal employes . . . after the Mitchell announcement, and people were really excited about the union of Sachs and Mitchell," Proctor said last week.

Schaefer supporters such as state Sen. Catherine I. Riley (D-Harford), who was on Schaefer's short list of lieutenant governor prospects, noted that Steinberg and Mitchell could not be more different.

"Mickey's full of energy, an interesting contrast to Congressman Mitchell, who seemed weary of public life," Riley said last week.

In choosing Steinberg, Schaefer spurned the advice of his Washington area backers, many of whom supported Montgomery County Del. Nancy Kopp, who also is Jewish and would have provided geographical balance to the ticket. One of those who supported Kopp was Maryland Democratic Rep. Steny Hoyer of Prince George's.

Hoyer noted that the suburbs here have often been overlooked in statewide politics, a trend that he said should not continue.

"I think people in the Washington metropolitan area ought rightly be concerned . . about . . . candidates not trying to include representatives" from this part of the state, Hoyer said.

But he said that Sachs' choice of Mitchell was a good one, saying that Schaefer's description of the Mitchell selection as a "narrow appeal" to black voters was "unfortunate."

The continuing political fallout from the lieutenant governor selections promises to affect far more than the governor's race, where the vote-getting power of the second name on the ticket has always been considered dubious.

Discussions have already begun about who will succeed steinberg as Senate president. Steinberg believes the frontrunner is state Sen. Thomas V. Mike Miller Jr. (D-Prince George's), a Steinberg ally who controls seven valuable delegation votes in the Senate.

Another suburban contender for Senate president is Montgomery County Democratic Sen. Laurence Levitan, who was also on Schaefer's list of possible running mates. Also being mentioned is state Sen. Norman Stone (D-Baltimore County).

"I've talked to Mike Miller and Norm Stone," Levitan said this week, "and the general consensus is we don't want to see a repeat of 1982, with its bitterness and trade-offs." That was the year Steinberg beat Howard County Sen. James Clark for Senate president after an acrimonious campaign.

In the House of Delegates, Schaefer's decision not to select Eastern Shore Del. R. Clayton Mitchell as a running mate has made Mitchell a leading contender in the race to replace Speaker of the House Benjamin L. Cardin, who is running for Congress.

Some parts of the state are not caught up in the intrigue of statewide ticket-making, however. "The lieutenant governor who-struck-John" may be going on, Paul Muldowney (D-Washington) said at a Hagerstown bull roast last weekend, but "it doesn't make any difference up here."