You need to provide context, your question is way too broad.
Depending on the context, к+dat. can mean "in the direction", "toward" and в/на + accus. can mean "in", "to" etc...
For example: ехать к школе - to drive to/toward the school; your goal may or may not be to go inside the building, all we know that you will be in the vicinity of the school
ехать в школу - to drive to school; your goal is more likely to go inside the building