Can a star form outside a galaxy?
Is it possible that in intergalactic space a star can form from a cloud of gas that's just outside a galaxy or can a star actually be ejected from a galaxy and establish itself in intergalactic space?
Dominic Ford provided this answer...
Dominic - Stars form from clouds of gas that we call molecular clouds and they form when the gravitational self-attraction of that cloud is stronger than the gas pressure which is pushing that cloud outwards. You can get a sort of chronic failure of gravity where the whole cloud collapses down to tiny points and begins fusion and becomes a star. It's actually quite difficult to trigger that initial condition where the cloud is dense enough to collapse down. You generally need something to give it some kind of compression to get the process started. One of the most likely candidates would be another star nearby going supernova, or if you're in a spiral galaxy like the Milky Way and you travel through one of the spiral arms, that's a density sound wave and if you travel through that sound wave, you're compressed and that causes a star to form.
In intergalactic space there aren't really any processes that could cause molecular clouds to collapse down like that and so I'm not aware of any theories that would allow stars to form in intergalactic space. But it's certainly the case that stars can be ripped out of galaxies and then become free-floating in intergalactic space. If, for example, two galaxies come very close to one another then the outskirts of those two galaxies can be thrown off at high velocity into intergalactic space. They form what we call strings with long strings of stars stretching out of galaxies into intergalactic space.