If you like sandy beaches you will be disappointed by both.
Dubrovnik has rocky shore, and some resorts built pebble beaches with pontoons, but nothing matching a beautiful sandy beach. It's a nice place to visit and to have fun, but I would not go there for the beach.
Istanbul is also not a good option for beach activities. It's a huge metropolis, but all Turks go to the Mediterranean resorts for weekend beach fun. It's a great city to visit, but don't expect beaches. Hotels have great pools though, if this is an alternative for you.