When I was a student an idea was popular in Soviet Union that war moves science.
I think this idea is correct in certain sense. If you include preparation to a war. Yes, some individual scientists were killed in action or in some other way as a result of the war. But on the other hand, if you mean by "war" the military competition in general, is not it clear that governments finance science, physics and mathematics first of all, to preserve their ability to develop top military technologies?
I witnessed a real boom in mathematics and science education, and in financing research both in Soviet Union and in the USA during the Cold war, and have no doubts about the real reasons of this boom. Especially nuclear bombs and space technology convinced the governments and the public that one has to invest in fundamental science and mathematics. (I don't have to explain that the whole enterprise of space exploration is a byproduct of military technology development during the Cold war, and also Internet, by the way).
And examples from the earlier epochs in history are also ample and well-known. Governments financed research in Astronomy and Celestial mechanics in 18th century for the needs of navigation, to maintain their colonial empires, Napoleon created the principal French scientific centers, etc.
War by itself is bad, of course. For science and for everything else. But preparation to war always was a powerful engine of development of science.