No, there is no direct ferry crossing from Ancona to Dubrovnik, but, there are ferries departing from Ancona and arriving at Dubrovnik via Split in Croatia. The journey, including one transfer, takes about 17 hours.