That is the purpose of McDonalds. I used it as a first step restaurant training ground for my kids. When they could behave there, they went to sit-down places like Friendly's and the local diner.
From there, they were ready for the big time, nice restaurants.
That’s a good way to handle it. Unfortunately for most parents, they fail to see McDonalds as a training ground so they use it as a playground instead. Kids need to play, to roughhouse, to run around, but not indoors. They need that exercise on a playground or in the backyard, or in a creek, or up a tree. Parents just need to each them when to behave and when to horse around.