In a nostalgic ceremony laden with election-year overtones, Vice President Bush today marked the 40th anniversary of his being shot down by the Japanese as a young bomber pilot during World War II.

To military music from the Atlantic Fleet band, Bush reviewed the sailors and received from Navy Secretary John F. Lehman Jr. a leather Navy jacket to replace the one he lost during his bombing mission. He inspected a nuclear submarine and a bomber like the one he flew in World War II and told an audience of 200 at the naval base here that a strong defense is the surest path to peace.

Echoing the controversial speech by Sen. Barry Goldwater (R-Ariz.) at the Republican National Convention last month, Bush suggested that Nazi aggression in World War II was spurred in part by U.S. weakness.

"We learned in World War II that you cannot appease totalitarians with weakness," Bush said. "In fact, it was the very pacifism of the democratic nations before the war that tempted the aggressors on. A strong and secure United States is the best guarantee of world peace."

The remarks apparently were directed at Democratic charges in the last several weeks that President Reagan's weapons buildup and foreign policy stance are leading the country closer to war.

But Bush and Lehman said that the ceremony was unrelated to the presidential campaign and was "a day for nostalgia," in Bush's words.

"The Navy recognizes its heroes even in a political year," Lehman told reporters. "This is a Navy occasion -- Navy-instigated, Navy-conceived and Navy-executed."

Bush dined aboard the USS John F. Kennedy with fellow Navy fliers from war days and with crew members from the submarine USS Finback, which rescued him Sept. 2, 1944. He was presented with a piece of planking from the Finback's deck and a plaque displaying the official account from Navy archives of his bombing mission.