Cozumel ... yes.
Book a cab to where ever, no worries. At the cruise ship piers the prices are listed actually.
Enjoy Cozumel.
Jamaica ... not quite as simple, IMO.
You can obviously book a cruise ship excursion and be corralled as usual. Or. ...
If you book a vehicle within the port , they are vetted and worthy. Trust me.
Having said that, it's best to have a plan in advance if possible in Jamaica.
There are many tour company's and private drivers that offer incredible tours of the country.
You could actually just dock and walk out south towards the country, bank right. And barter with the drivers, and select a suitable/satisfactory vehicle, that could accommodate your party. And have a great day with a private driver for half the cost of those that booked in advance.
Every vehicle within the port is vetted. You will notice this when you leave the port gates. They write the info down. Driver, pax, etc.
Please enjoy Jamaica. It is beautiful. It has wonderful people. It gets a bad wrap from a select few.
JME