Vehicles in container arrive at karachi first, then container is opened for customs checking, and if it is for karachi, it will be destuffed, which means car will come out of it and shipping company will take original bill of ladding from you and issue you a delivery order.
If B/L states, lahore, car will arrive at karachi and after viewing/checking by customs, it will be packed again and destined for lahore.
In every big city where there is no sea port, there is always a dry port with customs staff there, and it would be cleared there.