It depends which knowledge you are talking about.
Some knowledge tests might ask you the whereabouts of some streets, and the odd pub or public building, for example.
So you could tell which streets are at either end of an another street (say) just by studying a map, especially if you have a good memory. Likewise, you can memorise the location of public buildings from a map, and do the same with pubs using the yellow pages.
So you could probably pass some knowledge tests without ever visiting the place in question
However, the more difficult knowledge tests that require point-to-point directions really require the candidate to have learnt the streets while driving them.
However, one thing I've always wondered about the London 'knowledge boys' on their scooters, is it possible to learn that kind of thing from the armchair, or must you be on the road?
But it basically comes down to how stringent it is, but the best tests probably require a mixture of simply memorising things
and requiring a working knowledge gained from driving around.