I heard a friend saying
“it takes an hour by a car imagine a bus”
Is imagine used correctly here?
Your example sounds like very casual conversation.
What the speaker is saying is
It takes an hour (to get there) by a car, imagine (how long it would take using) a bus.
Quite often in casual conversation, shortcuts are taken and obvious words are left out, but the sentence in this context is correct.