The most widely accepted explanation is that there was a large body that exploded and formed fragments of different sizes. Some of the smaller particles combined with each other and formed masses, just as some of the larger particles formed the hosts of the small joining particles. So that there is a core of a planet just as there are layers of settlement above the core. Then, the smaller particles that did not form planets formed the smaller bodies such as planetoids and asteroids. The placement of these at the time of the propelling apart created the placements of them in the gravitational sphere of the sun, which created the solar system. The distances of these planets from the sun were verified in a physical law found by the astronomer Bode, who prior to the discovery of most of the planets successfully calculated their positions. This is referred to as "Bode's Law".
Yes, as idywthat says, THE BIG BANG THEORY is the most widely accepted one about the formation of universe, so in turn all galaxies.A cloud of interstellar gas and dust is called as nebula. The nebula is the birth place of many stars. But I am not sure if our sun and solar system also originated from a nebula.