Bergerac is at the western end of the Dordogne Valley region, if you want to visit the Dordogne for what makes it popular, the villages, castles, caves, etc, Bergerac doesn't have much to offer.
Also considering the Dordogne region as a whole, Bergerac is close to Sarlat, so splitting your time between Sarlat and Bergerac doesn't make sense.
If you are really passionate about the wines of the Bergerac region.. Cote de Duras, Montbazillac and other local appellations you can stay in either of these two places
But if it is about wines in general there are plenty of other places in the region with local vineyards to satisfy you. The wines of Cahors at the eastern end of the valley in Quercy are also very famous.
As already mentioned Sarlat is hell if you have a car, which is essential in the Dordogne. Staying in Sarlat is like staying in the visitor center of a national park. It is crowded with tourists. Moreover it is not really a central place to visit the Dordogne whose particularity is not really to be in a town with lots of restaurants and shops but to visit pretty rural areas with its small scenic villages lost in the middle of nowhere.
See this map to get an idea of the places to see in the Dordogne.
(I also put some winemakers where you can go for tastings)
https://www.google.com/maps/d/edit?mid=1OdPOg8AgsNn0Jlv1cNHkujaWv9p_Jpc&usp=sharing