It is not usually that easy. Many European docks are not exactly passenger friendly. A high-quality cruise line will have a concierge who can arrange to have a hired car ready for you when you arrive in port. More standard lines won't - but you CAN make a reservation for a car on the Internet for many ports you will be visiting on the Internet.
We once hired a car in Genoa and returned it in Florence. We even arranged to leave it at the dock and have the company come and pick it up.
Where is it you want to hire a car? Many car companies are international now.