What technology behind MRI scans was "built by the space missions"?
The underlying physical phenomenon is nuclear magnetic resonance. This was first observed by Isidor Rabi in 1938, well before the space missions. NMR spectroscopy was developed in the 1940s and 1950s, again before the space missions.
The first magnetic resonance imaging work was done by Paul Lauterbur in the early 1970s. Before him there was Raymond Damadian (who had the idea of using NMR diagnostically but didn't make any images) and after him there was Peter Mansfield. None of these people, so far as I know, had anything to do with space exploration.
Good MRI machines need very powerful magnets, which these days are made using superconducting wires. Superconductivity was discovered in 1911, long before space exploration was a thing. The first superconducting electromagnet was made by Yntema in 1955, before the space program; the first good superconducting electromagnet was made by Kunzler, Buehler, Hsu & Wernick in 1961; so far as I know they have no connection with space exploration.
But don't trust me. How about NASA? Here's a quotation from https://spinoff.nasa.gov/pdf/AIAA-2010-8885-305.pdf:
Confusion about NASA’s technological contributions to daily life exists even at the highest levels of government. In his speech at NASA Headquarters in January 2004 in support of the Vision for Space Exploration, President George W. Bush said, “Medical technologies that help prolong life—such as the imaging processing used in CAT scanners and MRI machines—trace their origins to technology engineered for the use in space.” This, like the previous examples, is incorrect. NASA has contributed in recent years to the advancement of several specific forms of medical imaging devices, and in the past the Jet Propulsion Laboratory has done groundbreaking research in the field of digital imaging. The CAT scan and MRI technologies, however, are specific applications for which NASA can take no direct credit.