Remember that before an officer can pull your vehicle over, he must have reasonable suspicion that criminal activity was taking place. Driving away from a bar or restaurant, by itself, does not give an officer reasonable suspicion that criminal activity was taking place. It will suffice if the officer pulls you over for a minor traffic violation with the pretext of investigating you for a DUI.
So if you get charged with DUI after leaving a bar or restaurant and the officer had no reasonable suspicion to pull you over or you did not commit any traffic violations, you may have a good defense. Any evidence obtained after an illegal stop is inadmissible, including evidence which may support a DUI conviction.