Optimaus Prime is from Cybertron, specifically Iacon, but that’s just the map coordinates. His real home is the fire in his chest—or, if you’re being goofy, the driver’s seat of a semi-truck. Next time someone asks you, just smile and say: “He’s from the same place as all great leaders: a story we needed to tell.” Then, if they roll their eyes, hand them a toy truck and say, “Drive this. You’ll get it.”
And if all else fails? Blame the writers. (They change it every reboot anyway.)