Democrat Harry R. Hughes, a forgotten man in Maryland politics just a few months ago, led Republican J. Glenn Beall Jr. by 38 percentage points a week before Tuesday's gubernatorial election, according to a poll published here today.

The poll, published in The Baltimore Sun, shows Hughes receiving 65 percent of the vote, compared to 27 for Beall and 8 undecided, Hughes was leading in almost every geographic region of the state and among every social, economic and religious group of voters.

Beall has not been able to make the major inroads into traditional Democratic strongholds necessary to offset the 3-to-1 Democratic edge in voter registration, according to the poll. He trails among black voters who he tried to woo by selecting the first black running mate in state history, Dr. Aris T. Allen, according to the poll.

Beall called the results of the poll, "pure baloney, The people of Maryland are capable of making up their own minds. They don't need to be spoon-fed or pushed into a decision on how to vote."

Nothing that The Sun published a poll two days before the Sept. 12 primary showing Acting Gov. Blair Lee III leading by a sizable margin, Beall said, "I feel the only poll that counts is Tuesday's and I'm going to win that one."

The Sun poll predicts a Democratic sweep of statewide offices. Democrat Stephen H. Sachs was leading Republican Warren K. Rich by 48 percentage points in the race for attorney general, while state Comptroller Louis L. Goldstein was ahead of his Republican opponent, Donald Devine, by 52 points in his campaign for a sixth term.

The apparent Democratic run-away in statewide offices conflicts with an extremely close county executive race in Prince George's where Republican Lawrence J. Hogan, the former U.S. congressman, is running neck-and-neck over incumbent executive Winfield M. Kelly Jr.

A tax-cutting charter amendment on Tuesday's ballot has dominated political dialogue Montgomery County, where Democratic State, Sen. Charles W. Gilchrist is running for county executive against Republican Richmond M. Keeney, a planning commissioner and former county councilman.

The Sun poll, taken between last Sunday and Wednesday, was the latest indication of widespread support for Hughes, the former state transportation secretary who stunned political oddsmakers by coming out of near obscurity to beat Acting Gov. Blair Lee III in September's primary.

Hughes, 51, a reserved lawyer from the Eastern Shore, moved quickly after the primary to unite the Democratic party and picked up key endorsements from labor and major newspapers, including The Sun and Washington Post. He has adopted a low-key campaign style, avoiding the type of controversial stands that alienate blocs of voters.

The poll published today shows he has grown in popularity since early October when the first Sun survey gave him a 33-percentage-point margin over Beall. The latest poll shows him attracting a larger number of the undecided voters than his Republican opponent.

In the survey, Hughes increased his percentage of registered Republicans who said they would vote him. The latest poll shows 30 percent of the Republicans canvassed favored Hughes compared to 23 percent in the October survey.

Geographically, Hughes greatest strength lies in Baltimore, where he has lived for seven years and practices law.Sixty-nine percent of the voters in Baltimore said they would vote for him, compared to 19 percent for Beall, who had hoped to offset the 7-to-1 Democratic edge by attracting large numbers of black voters.

While Beall and Allen are doing better among black voters than many past Republican candidates, they are still lagging far behind Hughes, who is regarded as having a good civil rights record. Hughes received 65 percent of the black voters polled, compared to 24 percent for the Republican ticket.

Hughes' campaign manager, Michael Canning, said he was "extremely encouraged" by the poll, saying it shows voters "don't have a good reason to vote against Mr. Hughes. He's an honest and candid candidate, he looks good on TV and he discusses the issues."

Canning said his only concern is that the large margin in Hughes' favor will cause overconfidence and keep Democratic voters away from voting places. "If the poll is valid at all," he said, "that would seem like the largest problem."

The margin thrust of the Hughes campaign in the next 48 hours will be to try to get out the vote on election day.

Since the primary, he has patched together an organization of local Democratic candidates with their own organizations and counts central committees augmented by a medium-size volunteer force. He as made peace with most of the Baltimore area's political bosses who supported his opponents in the primary, although it is uncertain how hard their organizations will work for him without the "walk-around" money he has refused to pay. (as has Beall).

Hughes has planned a moderately heavy media drive in the final days, giving him a last chance to enter living rooms with his central campaign theme: integrity in government.The campaign has budgeted $30,000 for the final week of advertisements.

Hughes will be competing over the airwaves with an equality intense media campaign by Beall, who plans to spend about the same amount in the Washington and Baltimore markets to reemphasize his campaign theme of fiscal conservatism. One of his television spots features an endorsement by Maryland's second U.S. senator, Charles McC. Mathias.

The Washington suburban vote has taken on greater significance for Beall this weekend since The Washington Post endorsed Republican Lawrence J. Hogan in the Prince George's County executive race. Beall campaigned all yesterday with Hogan in a caravan stopping at most shopping centers in Prince George's.

Beall strategists are counting on strong Republican candidates in Prince George's, Montgomery and Anne Arundel to give Beall a split in those counties. They believe that Allen will pick up support in black Baltimore and Beall is also expected to do well in Baltimore County and the Eastern Shore because of his appeal to conservative voters.

If the Republican candidates can hold their own in the populous Washington and Baltimore areas, Beall will win the election with a good showing in his native western Maryland.

"I think we're doing better than most people think," said Beall campaign director John Shlaes. "Previous formulas about how candidates win are out the window in this one."