
S-Mom asked Dragon to take Shanks and Shamrock and have them be raised by someone kind.
Clearly, Dragon heard enough from Garp to realize that Roger isn't really evil, just on the other side of things.
If Dragon gives Shanks to a Marine, or Celestial Dragon, he knows Shanks will end up in Marijoa.
The only people that would take the baby, and not do something crazy, would be pirates, who would just be like "oh... shit, it's a baby."
At this point, Dragon has probably excepted death... but, baby's are kind of goofy, and just do whatever they want.
Luffy "stole" the Fruit Shanks had taken from Cipher Pol/Who's Who:
My crack theory for Dragon's Fruit, is that he didn't even try to eat it himself.
Where-ever Shanks is, people eat Devil Fruits in stupid ways.
Buggy ate his after Shanks scared the shit out of him.
Luffy ate his because Shanks left the chest in front of Luffy, and Luffy was hungry.
Baby Shanks just shoving a Devil Fruit into Dragons' mouth is pretty funny, and fits the level of random bullshit that occurs whenever Shanks is around a Devil Fruit
https://www.reddit.com/r/OnePiece/comments/103y7f2
We know from Volume 4 Billion that the Roger Pirates found Shanks in a chest on the Queen Anne's Revenge post God Valley.
Barring some Kuma teleportation, I believe Dragon snuck onto a Pirate ship, put Shanks in a chest, and then, Shanks plopped the Fruit into Dragon's mouth.
Realizing he had a chance to escape, Dragon flies away as the island becomes completely engulfed in flames, trusting his father's enemy, Roger, who he's heard so many stories about, to raise the child Shanks and Shamrocks' mother gave to him.