There are two possible ways:
Choose Treeko as a starter Pokemon
Or
By trading
Chat with our AI personalities
Ruby, Sapphire and Emerald.
In Pokémon Ruby, you can only catch Treecko by selecting it as your Starter Pokémon if you picked Torchic or Mudkip as your Starter Pokémon then you cannot find it or receive it in the game however you can find someone else locally that would be able to trade you Treecko additionally you could have Treecko from Pokémon Sapphire and you could trade it over to Pokémon Ruby in order for Pokémon Ruby to get Treecko.
you have to beat the elite four and go to the pal park or transfer it from ruby,saphier or emerald
For Ruby, Mudkip. For Sapphire, Treecko. For emerald I do not know
After you fix the machine on 1 Island with the ruby and sapphire, it allows you to trade with the games emerald, ruby and sapphire. You can trade a Treeko from one of those games to FireRed.