As we all know that Luffy’s devil fruit is Hito Hito no Mi, Model: Nika, a Mythical Zoan-type Devil Fruit that allows its user to transform into, and gain the powers of, “The Sun God Nika”. In doing so, the user’s body gains the properties of rubber and the power to bring smiles to people’s faces. Those who awaken this fruit are known as the “Warrior of Liberation”.
It was originally a treasure that was heavily guarded by the World Government for an unknown period of time until it was stolen by Shanks and his crew. It was then accidentally eaten twelve years ago by the series protagonist, Monkey D. Luffy.
We didn’t know exactly what fruit Luffy ate until recent chapters. But I think Garp already knew about it before, that’s why he took Luffy and hid him with Ace. It wasn’t to train with Ace, it was to protect Luffy.
The World Government would’ve killed Luffy along with Ace upon discovery. Since Luffy was hidden for a decade, they probably assumed Shanks still had the fruit, and that Luffy had a fruit similar to rubber (like Katakuri’s mochi, or how there’s like 4 variations of Oven’s fruit, there is actually a candy logia, etc…). That’s why the Five Elders didn’t know until Shanks told them.
Garp was angry with Shanks for allowing Luffy to eat the fruit, not pushing him towards piracy. Luffy always wanted to be a pirate even before Shanks. Shanks put an immediate death sentence on Luffy.
At first, Garp pushed Luffy towards being a marine before he ate the fruit because of his Navy pride, but he later pushed both Ace and Luffy more seriously to save their lives because he knew they both would 100% be hunted and killed if word got out and they got caught. In his eyes perhaps if they worked for the Navy, they’d be spared immediate death.
Also, I believe that Dragon isn’t Garp’s bio kid. That during God Valley, after Rocks D. Xebec fell, Garp took his kid and raised him. Luffy is a product of Dragon and Garp’s daughter. This is why Roger trusted Garp enough to tell him about Ace and One Piece/Joy Boy.
When Roger tasked Shanks to find the Nika fruit, he also told him his plan that Garp would be protecting his child, which is why he came to Windmill Village with the fruit for Ace in the first place. Since Roger told Garp about Joy Boy he immediately knew it was the Nika fruit.