These can get tricky as the conventions aren't always consistent. But in general, we use "in" when A is inside B, that is, physically surrounded by it. We use "on" when A is on top of B. We use "at" when A is beside or otherwise near B.
That said, your example immediately brings up a couple of special cases:
A building is said to be "on" a road if it is along side the road. That is, it doesn't have to be sitting in the middle of the street to be "on the road". I guess it's consistent if you think of the road as not just the place where the cars drive but as extending under the buildings.
Even though you normally go inside a restaurant to eat, we don't normally say "I ate in the restaurant", but "I ate at the restaurant". Similarly for most other things normally done in a building, but where you are referring to it as an organization more than as a building: "I work at XYZ Company", "I shop at Bargain Mart", etc. We use "in" only when we are specifically referring to the building. Like, "Do you want to eat in the restuarant or on the patio?" "I live in an apartment." Etc.
So, assuming the McDonalds is in the mall and the mall's address is Sixth Avenue, you would say, "We had dinner at McDonalds in the mall on Sixth Avenue."
You still say "on" whether it's avenue, street, road, or whatever. I can't think of any type of road designation that would make it different.
Note that if you want to say that a location is near a certain intersection, you will say "at Elm Street" or whatever the street is. Like, "The mall is on Sixth Avenue at Elm Street" means that the mall is along Sixth Avenue near the intersection with Elm Street.
Also, "in" can be used in both a 2-dimentional and a 3-dimensional sense. That is, you are "in a building", but you are also "in a city" and "in a province".
And there are always exceptions. Like you ride "in a car", but it is common to say you flew "on a plane" even though you were not a dare-devil clinging to the top as it flew but were actually inside.