Running up and down hills will certainly make you stronger. Some runners do “hill repeats” by finding a hill and running up and down several times. The potential problem with hill repeats is that running downhill takes a toll on the quadriceps muscles, which are often weak in distance runners who don't make the effort to strengthen them with cross-training exercises.
You don't need to run hill repeats to reap the benefits, though. Finding a long training run that includes some rolling hills, if possible. Not every long run has to be hilly, but even if you can do a hilly long run once or twice during your marathon training, you will get the endurance benefits of a long run and the strength building benefits of hills. Don't run up and down the stairs. This type of running is jarring to the knees, and you are more likely to trip on stairs than you are to trip on a sloping street.