TOKYO (AP) _ Stock prices surged in Tokyo today following a rally on Wall Street, while the dollar inched up against the Japanese yen for the third consecutive day.

The dollar closed at 132.78 yen on the Tokyo foreign exchange market, up 0.15 yen from its close of 132.63 on Monday.

It opened today's trading at 133.05 yen and rose at one point to 133.30 yen, but fell as low as 132.60 yen during the day amid conflicting rumors about what the latest U.S. trade deficit figures would show when they are announced on Thursday.

''The market will not make a major, decisive move until Thursday,'' said Alan Yamashita, foreign exchange manager at Goldman Sachs in Tokyo. ''Everybody is still fundamentally bearish.''

Lack of improvement in the U.S. deficit would hurt the dollar, which has edged up 0.20 yen in the last three trading days.

On the Tokyo Stock Exchange, the 225-stock Nikkei average closed 361.82 points higher at 22,948.34. After shedding 86.89 points Monday, the index jumped by more than 200 points minutes after the start of trading in reaction to overseas gains.

Dealers said, however, that today's light trading volume meant the Nikkei's rise was probably not substantial.

A senior official at a foreign brokerage said the index's gain was tied to today's beginning of a summit meeting between President Reagan and Soviet leader Mikhail S. Gorbachev in Washington.

''This market tends to take moves toward detente more positively than others,'' he said. ''The market is quite happy about prospects for Reagan and Gorbachev, but that is a rather passing thing.

''By the next week the market will have forgotten about it.''

In New York, ''the Dow Jones seemed ready to test 1,738'' - the low recorded in the Wall Street index on Oct. 19, said Ron Napier, a vice president at Salomon Brothers. ''Instead it came back Monday with a 45-point gain.

''There's some breathing room again, and that translated into optimism for the Japanese market as well,'' he said.