A moon forming from a collision or with the leftover stellar dust from planet formation, the two are not mutually exclusive. The end result could or could not be similar mineral makeup of the planet and its moon. A planet in the making can sustain many collisions but those collisions may or not help form a moon or moons.