I would just like to know if this would be scientifically possible, even if highly unlikely. When the universe was still being formed and massive pieces of rock where floating around what is now the milky way, would it be possible for a "rock" to have floated away from the "milky way" and drifted through space for millions of years before entering the into the gravitational pull of a sun and end up orbiting it?
I'm not an astronomer, but I don't see why not. A comet is the leftover chunks of rock and ice that remained after stars and planets were formed billions of years ago. They drift around in space but can be attracted by the gravity well of a star or large planet. The heat of a sun can vaporize frozen water, giving a comet its characteristic "tail." It's conceivable that a comet could be captured by the gravity of a sun but this is where things get iffy. If a comet were to fall to far into the gravity well, it could eventually fall into the sun. If a sun were to only brush the fringe of the gravity well, it might go into an irregular orbit. Haley's comet has an irregular orbit that brings it back to our solar system once every 76-79.3 years. The odds of having a star capture a comet are small but not impossible. From what I've read, it's actually more likely for the gravity of a giant planet to affect a comet instead of a star. Reference: Amazing Space, Q & A About Gravity: http://amazing-space.stsci.edu/resources/qa/gravity.php.p=Capture+the+cosmos%40%2Ccapture%2C%3EGravity%40%2Ccapture%2Cgravity%2C%3EQ%2Aamp%2AA%3A+Gravity%40%2Cresources%2Cqa%2Cgravity.php
It would take an extremely long time for a rock in intergalactic space to drift in and get captured in a star's gravity well. If it were travelling fast enough to shorten that time significantly, it would be travelling too fast to be captured. Even if it were only captured from interstallar space (between local stars), in order for it to be captured, it would have to lose velocity (kinetic energy), or else it would simply contiinue on its way in a different direction. That would require collisions with smaller rock or ice particles, or passing through the fringes of an atmosphere or a gas cloud. If it conytains a large enough quantity of metals, passing through magnetic fields could cause it to lose kinetic energy as heat to be captured. If, like a comet, it consisted largely of frozen gases, the heat of the sun could cause it to lose material, which can cause an effect like maneuvering jets to slow it down enough to be captured. A body captured in this way will very likely have a very elongated orbit. It is not at all likely to attain anything close to a circular orbit. That's really the crux of the problem - the existence of rogue rocks between stars is not at all unlikely, but for one to be captured into an orbit is much more difficult.
the milky way itself is a galaxy that is made up of 200 to 400 billion stars, so how does that make any sense?
I agree. I think any such orbit would be highly irregular. As I said, Haley's comet has an irregular orbit that brings it back to our solar system once every 76-79.3 years. As bad as this sounds, it should be noted that it takes 248 years for Pluto to make one orbit around our sun. It takes Neptune 165 years to complete one rotation ... so the irregular orbit of Haley's comet is really nothing when you look at this in context to some of the planets in our own solar system. The chances of a comet achieving a stable orbit would appear to be vanishingly remote.