A Baltimore-based Pepsi-Cola bottling company is seeking to acquire the controlling interest in the Macke Co., of Washington, one of the nation's oldest and largest vending businesses.

Allegheny Beverage Corp. yesteday revealed in an announcement it has been buying up Macke shares and recently made an offer to the Washington firm's largest owners to buy all of their stock -- about 690,000 shares, or 23 percent of the common shares outstanding.

In an subsequent interview, Macke Chairman Meyer Gelfand said Allegheny Beverage -- half the size of the Washington company in terms of annual sales -- had offered to buy the controlling interest at a premium of $15 a share for an investment of more than $10 million. Macke's stock has not been above $13.75 a share in the past year.

To date, Allegheny had acquired 145,000 Macke shares (4.8 percent of those outstanding) with an investment of $1.3 million. On the New York Stock Exchange, Macke shares fell sharply earlier this year but have recovered smartly in recent weeks -- apparently during the time Allegheny was buying shares.

Macke stock gained more than 20 percent in price last week to close at $8 a share after a low of $5.25 in the past year. In trading yesterday, Macke jumped $2 a share to $10.

According to Gelfand, the approach from Allegheny Beverage "all happened very fast." He said the Baltimore company made its first move last week, through intermediaries, and a former offer was made at a meeting here on Monday afternoon.

Essentially, Allegheny wants to buy the shares owned by Gelfand and his family, and by former Macke chairman Aaron Goldman and his family. Goldman, who was Macke's president for a quarter-century and retired as chairman in 1975, owns the largest single block.

"It came out of left field and we haven't had the opportunities yet to meet with our families . . . my brother and two sisters and Goldman and his two brothers . . . we're not prepared to comment, I can't speak for them or even for my own family yet and each decision will be different because of different financial impacts," said Gelfand, who owns the second-largest block of Macke shares after Goldman.

The Macke chief executive said Allegheny representatives had said they were buying Macke shares for investment but the Baltimore firm was leaving "all of its options open," in terms of a possible offer to buy additional non-family Macke shares.

Allegheny Vice President Harry Conn would not comment on whether the bid to buy up further stock was an investment or a prelude to a takeover move.

Macke, founded here in 1926 as the G. B. Macke is larger by far than Allegheny with sales in the fiscal year ended last Sept. 30 of $261 million and profits of $5.7 million, a record year. The firm employs about 11,000 persons at restaurants, furniture stores and vending and services operations throughout the eastern half o the United States.

Allegheny Beverage, founded in 1966, operates bottling and canning franchises for Pepsi-Cola products in the Middle Atlantic region from Harrisburg to Norfolk. Other soft drink brands produced and sold under franchises include Dr. Pepper, Schweppes and Dad's Root Beer in addition to Allegheny's own "Suburban" and "High Rock" brands. Allegheny earned $4.8 million on sales of $129 million in 1979.

Allegheny said that although no formal agreements have been reached with Macke's principal owners, the Baltimore firm will "continue to explore all options including the availability of financing to purchase Macke shares."

Because of disappointing restaurant results, Macke's earnings dipped in the first fiscal quarter ended Dec. 31 to $985,000 from $1.4 million a year earlier. Gelfand said yesteday that second-quarter results are not yet completed but he expects that "relative to last year" the recent quarter's profits probably were better than in the first quarter.