A dog carrier is a safer way to travel from A to B with your four-legged friend. In a dog carrier, the dog is protected, has a place to sleep and relax, and cannot run all over the plane or car during the journey.
If you want to travel by plane, make sure you follow the size and weight regulations of your airline. Also find out before you travel which dog bags are allowed by the airline.
There are also special dog bags that are definitely approved by the usual (German) airlines.
If you are travelling by car, you should fasten your dog's seat belt. In Germany, § 21a of the German Road Traffic Act (StVO) makes it compulsory to wear a seat belt for both people and dogs.