This question presupposes a false distinction.
If the perimeter was a line drawn on a flat surface (cricket pitch, for example), a pedant might say you could only walk round it if every footstep fell directly on the line.
If the perimeter was, say, a line of close-set spikes sticking three inches out of the ground so you couldn't actually walk exactly on them, "walking the perimeter" would apply equally to just inside or just outside the line (or indeed randomly crossing over the line sometimes, thus including both).
It just so happens you can't normally walk the inner perimeter of a building, because there are usually dividing walls in the way. So by default it's assumed you mean the outer perimeter. If it is physically possible, and you want to say you're going to walk the inner perimeter, just say that. There is no more succinct way to express the difference.