Whether you are allowed to take a rental car to Dubrovnik through the Neum Corridor depends on which rental company you choose. In all cases, you need to inform the company in advance. Some charge a fee for this, will others don’t.
Taking a ferry is usually possible, but you must tell the rental company in advance. You will also always be charged an additional fee for this and be liable for any damage that happens to the car onboard the ferry