In the US, airplanes can be cleared for landing while the runway is occupied (you can be number two, three, etc. for landing and still be cleared). It's different in other countries, where you can only be issued a landing clearance if the runway is clear or anticipated to be clear before you land (e.g. the plane before you is already exiting the runway).
The way it's supposed to work, the ground controller first verifies that there are no traffic conflicts before clearing vehicles to cross an active runway.