When you plan on taking your pet somewhere in the car, even just to the park, you should consider restraining your pet.
Unrestrained pets could easily cause an accident by distracting the driver. By having windows down and allowing dogs to let their heads out the dog may fall out of the car or jump out and be seriously injured or killed.
For cats, it is easiest to put them in a carrier. The carrier can be secured with a seatbelt.
For dogs, you can get a special belt which clips on the collar/harness of the dog as well as the seatbelt.
There are different things available on the market these days, so please make sure you keep your pet and yourself safe when travelling.