The G.I. Joe directors said it was unlikely, but not impossible.
Before I continue, let's look at all of the movies and remember some things.
This movie involved the transformers arriving on Earth. Their presence became known to the world. The Autobots stopped the Decepticons and the end and killed Megatron. At the end, the humans made peace with the Autobots.
Transformers: Revenge of the Fallen
In this movie, taking place 2 years after the first, the military and Autobots formed a joint ops team called N.E.S.T. Covertly operating, the team worked to extinguish all Decepticon presence of Earth.
G.I. Joe: Rise of Cobra
Yo Joe! In this movie, covert operatives from all over the world form the top secret G.I. Joe. Knowing is half the battle. When all else fails, they don't. I loved this movie. However, it could have been better. Much better. Same with some of the Transformers movies. They could have been better, but they were great films. Action-packed and hilarious!
Transformers: Dark of the Moon
This one, things got real. The government wanted the Autobots OFF of Earth completely. Optimus Prime had a brilliant plan though. The Autobots faked their deaths and hid while the Decepticons STILL returned and wreaked havoc on Earth. Optimus then returned and said "Your leaders needed to understand that with us gone, the Decepticons would NEVER leave your planet alone."
G.I. Joe: Retaliation
In this movie, the Joes are fugitives. Set up by Cobra agents inside the White House. Major destruction was caused in this movie. The Zeus Cannon. It completely destroyed London. They gotta bring Duke back somehow! There is no way THAT killed him! There was no shrapnel! They were outside, so that rules out blunt force trauma from the explosion. It shocked him, and his is comatose. That's the way it should be lol.
See that? In their next movie, how do you hold America accountable for all of those deaths? It's kinda hard to tie two franchises together that couldn't be more different already and then events like these happen.
Transformers: Age of Extinction
The N.E.S.T. human Autobot alliance has been terminated. This one takes place five years after the third movie. "Remember Chicago" refers to the third movie. A black ops division is illegally killing ALL transformers. They were killing Autobots too, their former allies. This movie shows the Autobots on the run, just like the Joes in their last movie. It ended with Optimus Prime flying off into space.
Now for how they could meet.
Say these franchises have existed in the same timeline already, but they have never crossed over. Why? Simple, they already had their own problems to deal with. For this to work, G.I. Joe 2 and Transformers 4 would have had to have taken place at the same time. Both teams are on the run. G.I. Joe would have to be fully operational again in order to come into the picture. I mean, G.I. Joe 3 would have to establish that. I say throw some Easter eggs in there to confirm that the two coexist.
(Duke is brought back somehow) Joe Ops are reestablished and fully operational. Ripcord is on over watch in the air, Duke, Roadblock, Snake Eyes and Scarlet are boots on the ground.They are on a mission in Italy, tracking down Major Bludd. They are supposed to bring him in, but the op goes south when the Cobra operative turns out to be a Decepticon in disguise! Remember Alice in Transformers 2!? Yeah! One of those, then that brings more Decepticons. Fun fun! "Command! We need Accelerator suits NOW!" Decepticons are coming at them from all directions. The Delta Six Accelerator suits are dropped onto the battlefield in a care package. Duke, Scarlet and Roadblock gear up in those and Snake Eyes is jumping and climbing on buildings, jumping on the Decepticons and killing them that way and being awesome! At this point, Bumblebee and Hound would have showed up.
That about sums up how I'd have them meet. I don't have an idea for how the whole movie could go, just how it could start off.
This happened too!