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.