Magmar can be obtained as a Magby on Route 227 and Stark Mountain with Pokemon Leaf Green in the GBA slot. It will then evolve into Magmar at level thirty. As such, Magmar is not obtainable if you lack Leaf Green. Your DS must also have a GBA slot.
Hope this helps