Taking the second question first:
Is there any explanation on how the 2 universes could merge or it is
just a thoughtless commercial combination?
For the most part, yes, in 2008 Hasbro launched the Transformers Crossovers line; this was purely for commercial gain, and it was never done with any intent of defining canon.
Now taking the first question:
How could it possibly happen?
Parallel/alternate universes and bridges between them are always a good explanation for these types of things.
Depending on which representation of the Transformers you are referring to (there are a number of different representations of the Transformers in media), there is support for the idea that alternate universes do exist in many versions of the Transformers universes:
- In Generation One (the first appearance of the Transformers in comic form in the US), Spider-Man appears in issue three, implying that the Transformers exist in Earth-6161, which is one in many alternate realities (which are able to be bridged, as the Exiles did regularly, as it was their mission to protect the Multiverse) within the Marvel Multiverse.
- In October of 2007, Marvel and IDW published a New Avengers/Transformers crossover which did not take place outside of Earth-616 (again, existing in the Marvel Mutliverse).
- "Infestation" was a mega-crossover event among all of IDW's major titles, including the Transformers series. The core of the event hinged on bridges between alternate universes.
- "Chaos" was released in 2011, and in it, Galvatron believes he is on a righteous path to save Cybertron from an attack launched from the "Dead Universe"defined as:
a mysterious and malevolent realm that exists beyond the plane of
"normal" space.
That said, it's safe to say that alternate universes do exist in the realm of the Transformers universe(s), and it's only through that could that universe and the Star Wars universe collide.
Now whether or not that actually did happen or supports this toy's existence is a separate question.
Basically, it could and it's not outside the realm of possibility but not currently supported in canon from either fictional universe.
1 It is debated whether or not the Marvel comics version of the Transformers existed in Earth-616. However, the opponents of that idea counter that the Transformers actually existed in Earth-120185, which still supports the idea that the Transformers exist within the Marvel Multiverse and subject to exposure from alternate realities.