Unlike Earth, space has extreme conditions (zero gravity, no air, direct radiation from the Sun, etc.) which can make the survival of living organisms difficult.
The survival of microbes has been studied by various research groups.
Microbes like Deinococcus radiodurans (extremophile), can survive at least three years in space.
According to an experiment conducted by scientists in space, bacteria tend to form a protective layer to survive longer under space conditions.
Tardigrades(water bears or moss piglets) can survive the direct exposure to radiation for 10 days.
Therefore, it can be said that a few microbes can survive in space but their life span would greatly differ.