The stock market ran up its most powerful advance in 3 1/2 years yesterday in a rally that produced dramatic gains in dozens of blue chip and glamor issues.

Analysts said the euphoric mood was inspired by hopes for a downturn in interest rates, and a "buy signal" from a widely followed Wall Street doctrine known as the Dow theory.

The heady atmosphere was typified by International Business Machines, the long-established No. 1 holding of investing institutions, which racked up a 12 3/8 point gain to 291 1/2 as of the 4 p.m. close in New York.

The Dow Jones industrial average soared 22.78 points to 883.49, for its biggest single-day advance since it gained 26.05 points on Jan 27, 1975. That put the average at its highest closing level since it finished at 887.43 on Aug. 10 of last year.

Advances swamped declines by a 4-1 margin on the New york Stock Echange.

Twelve of the 15 most active Big Board issues posted gains of a point or better.

The NYSE's composite index jumped 1.21 points to 57.82. Standard & Poor's index of 400 industrials was up 2.67 points at 113.98, and S&P's 500-stock composite index gained 2.26 points to 102.92.

Bill Board volume amounted to 47,450,000 shares, the heaviest turnover since 51,977,880 shares were exchanged June 6. Tuesday's volume totaled 34,810,000 shares.

Composite volume of NYSE issues listed on all U.S exchanges and over the counter totaled 53,650,630 shares compared with 39,495,400 shares Tuesday.

The American Stock Exchange index surged 2.01 points to 156.58, a 1978 high, and the average price of a share gained 17 cents.

The National Association of Securities Dealer's NASDAQ composite index of OTC stock climbed 1.35 points to 128.16, another 1978 high.

Analysts noted a rush of buying by the many investors who subscribe to the Dow theory. The theory says that when both the Dow Jones industrial and transportation averages established new highs for a significant period, holds, it represents a confirmation that the market is in an uptrend.

Because so many investors are aware of the Dow theory, any "signal" it gives can have a potent impact on the market, brokers noted.

Following IBM's lead among the glamor stocks favored by investing institutions were such issues as Polaroid, up 2 7/8 at 51 1/8; Xerox, ahead 2 3/8 at 60 Eastman Kodak, up 4 1/3 at 65 1/8; and DuPont, up 6 1/4 at 127.

"This says to me that the institution are getting turned on here," observed Larry Wachtel at Bache Halsey Stuart Shields.

Texaco was the most active NYSE listed issue, up 1/4 to 25 1/3, ex-dividend. Sears, Roebuck was second, ahead 1 7/8 to 26 1/4. The company said Tuesday it plans to open eight retail stores this month. Citicorp was third, up 1 to 24 7/8 in trading that included a block of 195,100 shares at 24 1/4.

Boeing spurted 5 5/8 and 79 2/3. The aircraft concern said it received a $156 million order from Thai Airways International for three 747-200B jets.

Colonial stores gained 2 1/4 to 33 2/3. Colonial directors have approved and recommended for acceptance Grand Union Co.'s revised tender offer for any and all shares of Colonial at $35 each.

Ashland Oil picked up 1 1/4 to 38.Tosco Corp was granted an order restraining Ashland Oil from making further purchases of Tosco shares.

Playboy Enterprises fe11 1 5/8 to 23 7/8. The company has received final approval on its site plan for a $75 million Casino-hotel complex in Atlantic City, N.J.

Among the airlines, National Airlines rose 1 to 27. A suit was filed in Florida at the request of National to restrain Texas International Airlines temporarily from acquiring additional shares of National. Texas International, listed on the Amex, eased 5/8 to 13 1/3.

UAL, Inc., the parent of United Airlines, climbed 2 1/4 to 40. United Airlines' July traffic was up 28.7 percent over year-ago levels. It also has asked the Civil Aeronautics Board to approve a new route linking the Great Lakes with Florida cities.

American Airlines added 1 5/8 to 18 1/2. American is proposing a simplified air fare structure.