At a certain market share anti-trust kicks in. The market share does not have to be at 100%, it can even be lower than 50% if your "niche share" in this market is large enough.
That assumes that Walmart is the franchisee of the McDonalds located in their store. I cannot find any evidence to support that. I found a WSJ article[0] that indicates that Subway locations inside Walmarts are run by individual franchisees. So it would probably be fair to say that yes, restaurants located inside of Walmart stores probably pay rent.