Honestly, if you have errands to run after work, probably don't offer to give your coworker a ride home. They want to be home just as much as you do.
If that's the only way they're safely getting home, then it is what it is, but otherwise, probably don't.
I would agree- if you said: “I can give you a ride- I just have to run some errands...” and I personally think you should specify. Like- are we dropping a letter in the mail box or are we going to target across town to do returns, or.... at the very least one should say something like “I think it will take X minutes or so out of the way...”
I think it depends. But- if it’s too far for a bus- anything but the more involved of errands would likely still make the ride beat the alternatives... depending. If they are in a rush- then the time taken for errands may defeat the purpose. It comes down to a question of if you’d known about the errands- would you have preferred an alternative? If I’m in a hurry and for some reason don’t have transportation- I may prefer to call a paid service for a ride if it will be faster, or bother another friend to come get me. Maybe I could take care of some work while I wait or something. It all depends I think- which is why personally I think the person offering should inform the other party there will be errands, so they can make an informed decision on wether it’s a sweet gesture but not actually a help; or wether they think that’s best for them.
Otherwise you’ve taken away their choice, and once they are in your car it may be harder or worse or impossible to find another way home if your schedule doesn’t suit them.
If that's the only way they're safely getting home, then it is what it is, but otherwise, probably don't.