I would say it is more dangerous for a dog to ride loose in the open bed of a pickup, only because it might jump out of the truck and into traffic (if my dog saw a rabbit or deer on the side of the road, she would be gone in a heartbeat). So in that situation probably safer on the roof rack in a cage.
As for hanging their heads out car windows, I let my dog do that all the time but worry that something might get into her eye.