A stronger dollar, firmer bond prices and hopes for a boom in corporate profits drove stock prices sharply higher yesterday as the Dow Jones industrials gained 25.35 points to reach a record of 2722.42.

Showing strength from the opening bell, the Dow rose about 40 points during the busy session, before losing part of its gain to late profit taking. Volume on the New York Stock Exchange totaled 213 million shares as advancing stocks outnumbered losers 7-4.

Despite occasional retreats, the Dow has moved from 2500 on July 17 through 2600 and then 2700. The fifth anniversary of the current bull market was marked on Aug. 13.

As the Dow rebounded from a 12-point loss Monday, market analysts expressed amazement at the way investors continued to greet each downturn as an opportunity to pour money into the market.

"The market is hypnotized by its own success," said Mark C. Dollard, senior vice president at Amivest Capital Management in New York.

"It's pie a la mode and it's Mother's Day. It's impressive," said Ralph Acampora, a market analyst at Kidder, Peabody & Co., New York.

The rise in the Dow average was accompanied by gains in the broader market averages.

The NYSE composite gained 1.72 points to close at a new high of 187.99. The Standard & Poor's 500 moved up 2.96 to 332.27. The American Stock Exchange index gained .77 to 362.18.

The Dow move was powered, in part, by rising prices for tobacco stocks. The stocks benefited from a U.S. appeals court decision that federally required warnings on cigarette packs are adequate to repel injury suits by smokers who claimed that the warnings were inadequate.

Philip Morris gained $6.75. RJR-Nabisco climbed $3.37 1/2.

The dollar strengthened yesterday in trading against foreign currencies, including the Japanese yen, aided by signs that the U.S. and Japanese central banks were coordinating efforts to keep the dollar from falling further.

U.S. Trade Representative Clayton Yeutter said in an interview that higher interest rates and a slowdown in the U.S. economy could result from a further drop in the dollar. In New York, the dollar climbed to 143.50 yen, up from Monday's close of 141.90. In Tokyo, the dollar rose to 142.90, from 142.65.

Treasury bonds gained, too, as the price of the benchmark 30-year bond rose a half-point to 99-11/32, lowering the yield to 8.94 per cent from 8.99 per cent.

"There's been a pretty good correlation between the markets," said Dollard. "The dollar goes down, the bond market goes down and the stock market goes down. The dollar goes up, the bond market goes up and the stock market goes up."

Dollard said he was still concerned about recent figures showing that the U.S. trade deficit is widening and indications that the rate of inflation is more likely to increase than decrease.

"I think the bond market's central concern is the fear of inflation," he said. The bond market figures it has seen the low point on inflation, he said, and the trend will be up. "The bond market focuses on the direction rather than the level."

Dollard said he was concerned, too, that a drop in the Japanese stock market, now at an all-time high, would affect the U.S. markets.

The markets now are so intertwined, he said, "that it's hard for one to take a beating without the other taking a beating."

Michael C. Aronstein, president of Comstock Partners Inc., a New York money management firm, said investors were buying heavily in anticipation of a 20 to 30 percent increase in third- and fourth-quarter profits this year.

Investors also like what they see for next year, he added.

"I think the market is beginning to capitalize on better earnings prospects for 1988," he said.

Aronstein said improved corporate profits were aided by price increases in basic industries, such as mining, energy, steel, machinery and capital goods, and by the savings from cutbacks and reorganizations.

"It's a combination. That's why it's so powerful," Aronstein said.

The analyst injected a note of caution, saying "I wouldn't use all the reasons I've given for the market going up for someone to put on their swim trunks and dive right in."

In fact, he said, his firm was moving increasingly into cash positions as the market climbed.

"There is a good chance we will see the highs for the year in the next three weeks," he said.

Kidder, Peabody's Acampora said of the height of the market, "Sure, I'm nervous when I see stocks go up and act like commodities. Our advice to clients is 'Play it. But don't go crazy. Be selective.'"

Acampora said he looked for a 100- to 150-point rise in the Dow in the next few weeks. He said he guessed that the top for the year might be about 2850.

"We could be there tomorrow," he said with a laugh.

Acampora said he saw "no euphoria" among market participants and was finding that, "Many investors are not enjoying this."

The investors enjoying it the least, he said, were those who had bet on the market turning down and had sold stocks short -- stocks they borrowed from brokerage firms -- only to watch the price of the stocks continue to rise and threaten them with substantial losses.

"I have to believe this is an unprecedented bull market," Acampora said.