If you can't (or prefer not to) run outside, you can train for a marathon on a treadmill. Note: this is not recommend for long training runs of 10 miles or more (although runners do run that far on treadmills). Treadmills offer a more forgiving surface than asphalt or concrete, and some runners find them a pleasant change from harder surfaces, and a more appealing option in the winter. But treadmill running does take some getting used to; be careful when starting and stopping your run so you don't fall, and make sure that your shoelaces are not dragging. And if you notice any leg or foot pain after a few treadmill runs, go back outside or try a different treadmill. A cheap model may not have a surface that feels good after 5-6 miles of running.
Want a hill workout? Most treadmills can be adjusted to various degrees of incline to make the run more challenging.