There are three classes of objects in the solar system–rockballs, gasballs, and iceballs.
Objects close to the sun are rocky because the volatiles have evaporated. Gasballs are objects massive enough to accrete a lot of volatiles from the early solar system. They are also so massive that their internal heat keeps the volatiles as gases. Iceballs are almost all volatiles, but small enough and far enough from the sun that the volatiles are in solid form. These form the outer dwarf planets like Pluto and also comets.
The moons of the various gas giants are small rockballs or iceballs or mixtures, depending on their origin and how much volatiles they have lost or gained over their history.
It’s probably not a coincidence that in our solar system we have rockballs close to the sun, then gasballs, then only iceballs. Any rockballs or iceballs with orbits near the gas giants will eventually probably end up captured as a moon, ejected into another orbit, or accreted. But there are still a few iceballs like Chiron within the orbits of the gas giants.
However, in other solar systems we know there are superjovian planets that are very close to the star, closer than Mercury. The current theory is that these objects started out farther away, but have migrated closer. Our solar system may not be a typical specimen. Or maybe it is, since it’s a lot easier to detect exoplanets the more massive they are and the closer they are to the star, and our sample of exoplanets is biased.