In Montgomery County, according to legend, there lives a little doll named Demmy Crat. Wind him up, and he does four things: holds grudges, refuses to speak to his friends, cuts off his nose to spite his face - and wins elections.

That Demmy's first three habit lead to his fourth is a source of amazement to some Democrats, in and out of the county. But there is no disputing that Democrats have dominated elections and solidified a 2-1 registration edge over the Republicans in the last ten years. The challenge now is to stay on top.

Some say the challenge is also to become democratic in process as well as in name. Others say the challenge is to become "democratic" the way Richard J. Daley might have defined the term. Still others say the challenge is to get part poohbahs in Annapolis and Washington to give political credit, and benefits, to their Montgomery brethren.

The only certainty is that all these challenges, and others, will be debated, debated and debated some more. For while Montgomery County Democratic politics are sometimes fractious and sometimes friendly, the one thing they always are is talky.

But that may be a symptom of the passion, issue-orientation and independence that characterize most county Democrats. If Mayor Daley had ever set up shop in Montgomery County, the odds are that the only machine he would have been able to construct would have been one that recycled tin cans.

"I'm an amateur," says the man with the best chance tobe a "Rockville Richard." He is James Doherty, 47, a lawyer and health lobbyists who took over as county Democratic chairman in December. But Doherty knows he can never be a Daley. "The reason is that we have no patronage. We have no jobs in the county office building elevators," he said.

"It's an amazingly good county, a clean county, added Esther Gelman, a Democratic County councilwoman. "And there are endless ways to get involved in Democratic politics. All you've got to do is get out of your warm chair and turn off the television."

The classic route into the party structure has been from PTAs and civic associations into the party's 144 precinct and six district organizations. Phyllis Goldberg, a precinct chairman in White Oak, did it exactly that way. "After a while," she explained, "the things you want to get done have to be done in Rockville or Annapolis."

Both the accessibility of leadership positions, and the feuds that a run for the top can produce, were demonstrated last fall when Lanny J. Davis ran for Montgomery County's seat in Congress.

Davis - bright, young, handsome and mediagenic - had lived in the county for only three years, and had never held a county or party office. Yet he won a Democratic primary that featured two heavyweight opponents. However, neither endorsed him after the primary and he was soundly beaten in November by Republican Newton Steers, despite the Democrats' registration edge of nearly 100,000 voters.

Davis is bitter about the experience, and forlorn about what it signifies.

"It's an unforgivable sin not to respect the will of the party rank and file as expressed in a primary," said Davis, who is now back at work as a downtown Washington lawyer.

"In Montgomery County, people will immediately suspect motivations and not consider larger questions. They fight past wars, they impugn past motives." Unless country Democrats stop doing this, Davis said, defeating Republicans "is going to be very difficult."

The record argues, however, that defeating Republicans in most recent county races has been a piece of cake.

All seven members of the County Council are Democrats. All but one of the county's 24 state senators and representatives is a Democrat.The state's attorney and most of the judges are Democrats.Still, Republicans hold the two most visible and powerful jobs, county exectuive (James Gleason) and congressman (Steers).

"Ah, the Republicans didn't win those, we lost them," explains Jim Doherty. He said he is determined to prevent losses "based on fratricide" in the future, and plans to concentrate his 1977 efforts on mending wounds so that 1978 will be a boom year.

Doherty took his first step along those lines soon after taking over. He named a party ombudsman: Roy Dickinson, assistant secretary of the 19-member Democratic central committee. Dickinson's job will be to mediate disputes between factions, old and new, and to keep everyone talking to everyone else.

"I tell them, 'You've hated each other for so God damn long, you've forgotten why.'" Doherty explains. "I am not going to ask them to love each other. I will ask that differences be aired in the open.

"My own role is to try to get these people to play in the same ball park.Damn it, if you said something in your basement, you ought to say it in the party caucuses."

Those take place once a month, and more often if necessary, at the party headquarters at 3720 Farragut Ave., Kensington. The office manager is the party's only paid staffer. The party has about 600 volunteers it can and does call on. Their chief activity at present is to prepare for the annual autumn "Dollars for Democrats" fund drive.

The Democrats have chairmen in each of the country's precincts, every one of which has a Democratic registration edge. Each precinct is given a quota by party headquarters before the annual fund drive. Small donations are typically drummed up by soliciting door-to-door, although the party also has a club for those who give $100 or more. Some precincts also hold $5-a-head parties of coffees at a volunteer's home, usually with a special guest on hand.

Doherty said he hopes to have raised between $80,000 and $100,000 by the time the 1978 races heat up. That would be about double what the central committee provided in 1976. Meanwhile, Doherty said, the committee is sniffing out prospective 1978 candidates and discussing ways to aid them.

All hands agree that the liveliest races in 1978 - and the most threatening to Democratic dominance - will be those for the County Council.

"The County Council is in sad political shape," Doherty said. "Anybody running in '78 is going to be in trouble." The reason: Voters will tend to blame incumbents for their increasing economic pinch. Doherty said. The Republicans may well pick up some Council seats as a result, Doherty said, "but it won't be four."

Democratic state's attorney Andrew L. Sonner also forecasts trouble, but he said it can be prevented if the Democrats hold a "pre-primary primary" across the entire county party. In the recent past, the party has formally chosen its candidates at a nominating convention. Sonner is a leader of a political faction called "Century 21," which is pushing the countrywide primary, as well as as servered other reforms intended to open the party and its processes.

"People running from safe Democratic districts don't answer their mail or their phone calls," said Sonner, "if we're more responsive, we'll do a better job. We'll have better candidates."

The party had better find some, Sonnar added, because the legal headaches of Gov. Marvin Mandel "will be big factor." Even if the governor is retried and found innocent, "he doesn't look as straight as six o'clock," Sonner said.

"The Republicans' lack of success has been one of our biggest problems," Sonner concluded. "They've made us lazy. They're so divided, they don't mount an effective campaign."

So why don't the Democrats win everything in sight? Esther Gelman think it's a matter of what she calls "the corruption of power," and the laziness that can beset those who have been in office for long periods.

"One strong , overbearing little leader in one district can work his or her will with just two or three other stooges. Concentrating power in fewer hands I do not consider a reform," Mrs. Gelman said. When Democrats lose in Montgomery County, she said, it is simply because local workers did not do enough to bring out favorable voters.

A concentration of power may become more common, Mrs. Gelman added, if country public servants continue to be paid less than she feels they deserve. That will lead to a county government of the rich, she warned, and "I don't think you should depend for your public servants on people who can afford it."

On the precinct level, Democrats seem to be people who can afford the time, and are spurred by commitment, not necessarily ambition.

Jenny Sue Dunner, for example, the party's precinct chairwoman in Kenwood and southern Bethesda, said her "kick" is the chance to work for issues.

"You don't have to be an elected official to make a contribution," said Mrs. Dunner, who added that she has no interest in elective office. "What I do isn't really drudgery. I just want to be successful in opening up the system in some way."

Rosalie Reilly, a former central committee member and now co-chairman of the state party, said such sentiments are frequent and genuine in Montgomery County. She adds, however, that "politics from the heart" is often mistrusted in Baltimore and Annapolis.

"I go to Annapolis and say, 'Hi, I'm Rosalie Reilly from Montgomery County,' and I might as well have said I'm carrying a bomb . . . I tell them the party workers go on dedication here, and they look at me like I'm coming out of the trees."

The problem in Montgomery County, according to Mrs. Reilly, is that "everybody wants to be a chief or a kingmaker. Lip service to fellow Democrats in this county is very apparent. I'm not condemning it. I just think you'll always have the factionalism. And I don't know what to do about it."

Factionalism has been a way of life in Democratic county politics since the late 1960s, when the party split over the Vietnam war and the 1968 presidential campaign. Matters worsened in 1970 when the county chairman, Richard Schifter, refused to endorse Democrat William Greenhalgh for county executive. In 1974, Idamae Garrott went down to defeat in her race for county executive, leading to bitter charges of nonsupport. In 1976 came the Davis campaign, over which the party is still split.

The one thing Montgomery County Democrats don't disagree about is that, given their mean levels of income and education, the livin' should be easier than it is. It will be, the Democrats agree, if taxes can be held down and business attracted. The debate, however, is over ways and means.

It tends to center on how to develop the county. Democrats have felt that the Republican-Dominated Council and delegations of the 1960s developed the county in scattershot fashion. A favorite 1966 Democratic campaign ditty, for example, went as follows: "I am a roaming builder/I build where'er I please/Next week I'll be on your block/To build a Tastee Freez."

But a sewer moratorium has been in effect across the county since 1972, limiting development severely. "The issue now is taxes, getting the bang for our bucks," said Doherty. If taxes are increased before 1978, as many in both parties expect, the Republicans may come up with a catchy ditty themselves.

But the Democrats will not lack for participants, or, almost certainly, disagreement.

"Maybe Frank Rizzo or Mayor Daley could bring a modicum of peace," said Doherty, sighing. "I can'even fix a traffic ticket. But my own view is that it beats the hell out of golf."