The crowds were sparse and the enthusiasm spotty as Edward M. Kennedy and George Bush campaigned around Maryland yesterday in hope of a victory in Tuesday's presidential primary.

The primary is crucial for both Democrat Kennedy and Republican Bush if they are to have any chance in overtaking Jimmy Carter and Ronald Reagan for their party's nominations, but neither candidate had much to be encouraged by.

Bush, on the last leg of a two-day campaign tour of the state, shook hands with scores of early morning commuters on their way downtown from the New Carrolton Metro station.

In the hours that followed Bush's campaign staff whisked the Republican candidate from a breakfast in Lanham in Prince George's County to a food market, a senior citizens center, and a rotary club lunch in Annapolis. aBut while his pronouncements were greeted with applause at every stop. The enthusiasm was minimal.

So, in fact, were the crowds. About 100 people gathered for the Ramada Inn breakfast where Bush was introduced by Republican Rep. Marjorie Holt, a popular four-term congress-woman from Anne Arundel County who earlier this year endorsed the former CIA director.

That, however, was the largest group of the day to assemble solely to hear Bush speak. And while they stood and clapped as the candidate entered and when he left, they showed little response as Bush reiterated his determination to stay in the race for the nomination, despite front-runner Ronald Reagan's commanding lead.

Meanwhile, the cold, drizzling weather and President Carter's ever-growing lead in the race for the Democratic presidential nomination apparently hindered Kennedy's ability to draw a crowd.

In stops at the Baltimore docks and in Little Italy, small gatherings of about 40 people awaited Kennedy's motorcade and fought for a chance to shake his hand. Most of those among them said they still hold out strong hopes for his candidacy.

About 20 steelworkers who met Kennedy at the Locust Point Pier complained about the layoff of 2,000 workers at the Sparrows Point Bethehem Steel plant. A shipbuilders union executive complained of dwindling federal susidies that he said have crippled his industry.

Both groups said they blame the Carter administration for their problems in Baltimore. "There's Mr. Carter's foreign policy over there," yelled shipbuilder Leo Chaillow as he pointed to a huge Japanese ship docked in the port, loaded with tons of Japanese steel nails for delivery in the Baltimore area.

Kennedy seized on the issues, blaming the Carter administration for policies that encourage the "dumping" of foreign industrial products in the United States. He said the policies lead inevitably to layoffs.

A longshoreman unloading the boat said he is not disturbed by the influx of foreign products since, "We don't care where it comes from, as long as we have something to load or unload."

But Kennedy warned that during an economic slowdown, "it isn't going to take long before it affects the job here in the port."