Maryland and Virginia delegates prepared to head home from the Democratic National Convention tonight with many expressing doubts about President Carter's chances of beating Republican Ronald Reagan in their states this fall.

Only in the District of Columbia, which only has three electoral votes at stake and where a Republican has never won a presidential vote, did delegates feel Carter could score a certain victory. And some of the president's strongest supporters in the D.C. delegation predicted that the winning margin could be the lowest in history.

Carter made an appeal for party unity tonight in his acceptance speech, which, along with other conciliatory gestures made during the four-day convention, boosted his political standing from its preconvention level and helped bridge the gap between his supporters and those of Sen. Edward M. Kennedy.

But even with those gains, many of the 142 Washington area delegates said, Carter may be unable to prevent apathy, Reagan and independent John B. Anderson from siphoning off enough Democratic votes to lead to the president's defeat in Virginia and Maryland.

Some Kennedy delegates did not stay to hear the speech, in which Carter said: "Ted, your party needs . . . your idealism and dedication working for us." One who did, Penny Rood of Fairfax City, said after the speech that she would support Carter.

Virginia Lt. Gov. Charles Robb said the speech was the best he had ever heard Carter give. But in apparent contrasting reference to Kennedy's electrifying speech Tuesday, Robb conceded that "Kennedy has always been able to make a spiritual message, while the president has not been able to make a spiritual message."

Among Maryland delegates, Rep. Barbara Mikulski -- a Kennedy supporter -- said she was encouraged by the speech. Uncommitted delegate Peter Messittee of Chevy Chase said the speech was good in substance but "in terms of style, it was a bummer."

Rep. Michael Barnes, of Montgomery County said: "It's going to be very, very tough this fall."

Here are the prospects:

In Virginia, some of the strongest pro-Carter delegates say Reagan is almost certain to carry the state. Carter's chances of winning Virginia's 12 electoral votes -- he lost them in 1976 -- were dimmed by liberalization of the party platform on the issues of abortion, the Equal Rights Amendment and government spending, and his failure to win over Virginia delegates supporting Kennedy.

Maryland Democrats, who enjoy a 3-to-1 voter registration edge over Republicans, will not concede the state's 10 electoral votes yet. But they acknowledge that Carter enters the fall campaign well behind Reagan, and that to beat him -- and Anderson -- they may have to wage a negative, "lesser of two evils" campaign and use the party's organization and loyalties to the fullest extent.

The District of Columbia sent a pro-Kennedy delegation to the convention, and many expect some of the Kennedy organizers to sit out the election. Many District gays and younger, middle-income families are expected to support Anderson, while the small number of D.C. Republicans go solidly for Reagan. The result could be a Carter showing far below the 82 percent he won in 1976.

"My position has been and is that unless the president demonstrates that he intends to act on the [traditionally Democratic] principles with respect to economic issues before the election, it will be impossible to rally the traditional coalition that has won elections for Democrats," said D.C. Del. Walter E. Fauntroy, a Kennedy delegate who switched his vote to Carter after Kennedy withdrew from the race on Monday.

Rosalie Abrams of Baltimore city, the Maryland State Senate majority leader and chairman of the state's Democratic Party, said, "we've got a real selling job to do. We've got to educate the voters about the difference between the Democratic and Republican parties. We've got to make them look at where the parties stand."

Thomas G. Stewart, a congressional aide from Annandale and a Kennedy delegate, was one of several Virginia delegates doubtful of Carter's chances of winning in that state.

"I think the only way Carter can win in Virginia is if the hostages are released on election day," he said. "I can tell you that it will be impossible for me to go door to door to ask for votes for Jimmy Carter." But, Stewart added, he will not work for any other candidate.

In many respects, the Washington area mirrors some of the major hurdles Carter must overcome nationwide to win reelection. Virginia is a Southern state, and Carter must win big in the South. Maryland has one of the most consistent records of supporting Democratic presidential candidates, and Carter must win Maryland. He also has to retain the traditional Democratic support of blacks and liberals, such as those in the District of Columbia.

Polls by Maryland politicians indicate Carter running a distant second to Reagan in the state and behind Anderson in Montgomery County. Reagan is likely to carry the state's rural areas and its developing suburban counties -- Baltimore County, Howard and Anne Arundel -- and thus Carter will have to win by good margins in Baltimore City and the Washington suburbs to compensate , delegates predicted.

Montgomery County politicians say Anderson could win as much as 25 percent of the vote there -- mostly from liberals and Jews in the county's eastern half. Some of them welcome a strong Anderson candidacy because they think it would help Rep. Barnes in his race against Republican Newton I. Steers.

Prince George's and Baltimore City Democrats are more sanguine about Carter's prospects in their areas, largely because of good party organization and a strong Democratic voting tradition. Carter's Maryland margin of victory in 1976 came primarily from Prince George's and Baltimore City.

In all areas of the state, delegates say that the Democratic game plan will be to scare voters away from Reagan by claiming that his foreign policy could lead to world chaos, his reductions in the workforce could cost federal workers their jobs and that he could reverse many of the civil rights victories of the last two decades.

"When you get down to the bottom line, people are going to have to go in the voting booth and pull a lever," said State Sen. Clarence Blount, a black leader from Baltimore. "And no matter what they think about Carter, when they think about economic issues, it will be hard for them to choose Reagan."

"They will be attracted in Prince George's by the Reagan homily about family, neighborhood and tradition," said Gerard T. McDonough, a County Council member. "We have to make them realize that they can't trust the Republican Party. It's a matter of following the old organization drill."

Maryland Democrats will have to unite to win the campaign, and many Kennedy delegates here this week appeared reluctant to work for Carter.

The president's supporters hope those delegates will change their minds later. "Once they get back home and a couple of weeks pass, they will be out working," McDonough predicted. "They'll start thinking about Ronald Reagan as president, and the party organization will come down on them."

Some of Carter's strongest supporters here were less enthusiastic about his prospects and were candid about his problems.

D.C. Democratic Chairman Robert B. Washington Jr. said that the threat in the District will not be from Reagan and the right, but from Anderson and the left. "I think Anderson's is a serious campaign. I think he'll have impact," Washington said.

Anderson has taken stronger stands than Carter on jobs and economic development. He also has more support among homosexuals, who are one of the most important forces in District politics.

Anderson's strongest appeal is expected to be in the mostly white areas of the city -- the liberal and transitional neighborhoods that ring downtown and, to a lesser degree, the area west of Rock Creek Park.

Carter's base in the District is in the mostly black, middle-class areas on the outer stretch of the city -- from east of Rock Creek Park around to Anacostia. Most of these voters are Democrats and they have a good record of turning out to vote.

Fauntroy said, however, that voter turnout among blacks could be hindered if Carter does not take action soon to ease the financial squeeze and create more jobs. "I will support him," Fauntroy said. "But we will not be able in the black community to generate the quality of support that Carter enjoyed in 1976."

Still, D.C. Mayor Marion Barry said today that Carter could expect to get only 60 to 70 percent of the vote in the city. "If the election were held today, Carter would get less than 60 percent," he added. "By Nov. 4, Carter will get at least 60 percent."

Virginia's delegation came here with a lopsided 59-to-5 Carter majority. But Carter's repudiation of some Kennedy-sponsored platform planks infuriated Kennedy backers, and his acceptance of other planks disturbed conservatives who supported him.

The result was a Virginia delegation strained on both sides. Lt. Gov. Robb said today that the president will have "an uphill battle" to carry Virginia. Many state leaders conceded privately their belief that Reagan would win.

Virginia Democratic Chairman Richard J. Davis said today that party members are "better organized now, Aug. 14, than they were on election day four years ago." He predicted that the prospect of Reagan as president would unify the Kennedy-Carter factions.

But Kennedy delegates from Virginia, who had earlier criticized some efforts to win their support, today had more strong words for their Carter counterparts.

"One minute they hug you, and the next minute they slug you," said Cecily Coleman, a 25-year-old student and Kennedy delegate from Alexandria. c"Right now, the way I feel, I just may not vote at all for president, and that makes me feel horrible."

Carter is already in trouble in Northern Virginia. He has changed civil service regulations and imposed parking fees on some federal employes. Many Northern Virginia liberals also feel he has abandoned his 1976 campaign promises.

In that year, Northern Virginia voted for Gerald Ford instead of Carter. Virginia Democrats say Carter must carry the Washington suburbs to win the state, but they think he may do better this time because he is running against a more conservative Republican opponent.