You can use a cheat. Otherwise, there is no way.
you cheat
you find magmar in the burned tower in ercuteak city
you do trade!
You must trade Magmar while holding the Magmarizer
It is one of the first 3 Pokemon you can choose, that is the only way to get it without trading
burned tower
You can Magmar at the Burned Tower. Go to Kanto ,after beating the Elite Four, Magmar will also spawn in the Mt. Silver.
If you breed magmar and ditto, you will get and egg that will hatch into magby.
Not without trading from a 3rd gen game.
cheats
u need to treade it with a magmarizer
You can find it inside the Burnt Tower in Ecruteak.