NEW YORK (AP) _ Stock prices regained ground Tuesday following a sharp sell-off in the previous session, but investors became nervous as tanks rolled toward the Russian Parliament.

Developments in the Soviet Union dominated the market for a second day, with the Dow Jones average of 30 industrials gaining 15.66 points to 2,913.69. Bargain hunters entered the market early in the session, finding deals after the Dow dropped 70 points on Monday, the sharpest decline in 10 months.

The buying, inspired by a similar trend in the Tokyo and London markets, helped push the Dow up by more than 25 points after the opening bell.

Investors became queasy following reports that Communist hard-liners ordered a column of tanks to roll toward the Russian Parliament, the stronghold of the defiant Russian President Boris Yeltzin.

''Theoretically, you would like to step forward and buy on weakness, but if something goes wrong, then you would get caught in a sell-off like yesterday,'' said Walter Murphy, senior international market specialist for Merrill Lynch Inc.

Trading volume illustrated traders' cautious mood. On the floor of the Big Board, 184.17 million shares traded hands as of 4 p.m., down from 229.59 million in the previous session.

Advancing issues outnumbered declines by about 2 to 1 on the New York Stock Exchange, with 1,068 up, 543 down and 481 unchanged.

Reflecting on Monday's blizzard of trading, analysts said the sudden overthrow of Soviet President Mikhail Gorbachev will strengthen the United States' reputation as a safe haven and attract foreign investment in times of international turmoil.

''The strength of the dollar is appealing to foreign investors,'' said Alan Ackerman, executive vice president at Reich & Co.

The Dow posted a 2.4 percent loss on Monday, much milder than losses on foreign exchanges, Ackerman said, where stock prices plunged 5.95 percent in Tokyo and 9.4 percent in Frankfurt.

''The U.S. market was able to shrug off the shock factor better than the others,'' said Ackerman.

Investors are expected to shy away from Germany because the Soviet crisis could create a huge refugee problem there, and burden an economy already struggling with the costs of reunification, said Tim Shea, portfolio strategist for C.J. Lawrence Inc.

The crisis continued to help defense stocks listed on the NYSE. General Dynamics gained 2 5/8 at 46 3/4 ; McDonnell Douglas rose 4 1/4 at 55 ; and Lockheed rose 1 5/8 at 45 3/4 .

In other developments, H.J. Heinz rose 1/4 at 45 in heavy trading following speculation that it may be involved in a takeover. Heinz's stock hit a new high in intraday trading, with the stock up by 2 1/8 at 46 7/8 before a wave of selling drove prices down. A Heinz spokeswoman declined to comment the rumors.

Deere & Co. was down 2 5/8 at 46 7/8 after the tractor maker reported anticipated third quarter earnings of $31.3 million, down 72 percent from the same period a year earlier. A worldwide recession had dampened demand for its products.

On the American Stock Exchange, shares of Plains Resources Inc. nearly doubled in value, jumping 6 1/4 at 15 1/4 following reports the Oklahoma oil and gas driller made a big natural gas discovery in Louisiana.

Westinghouse Electric was the most active issue on the New York Stock Exchange, up 1/8 at 22 5/8 . Other actively traded issues included Wal Mart, up 1 1/8 at 48 5/8 ; General Motors, down 3/8 at 35 1/4 ; and American Telephone & Telegraph, up 1/8 at 38 1/4 .