While few African capitals offer gourmet fare, many have very good restaurants serving local dishes. No need to head for the local Italian (unless you've been without for a few months), just ask the hotel manager where s/he would dine out. Read up on local specialties before you go. Many East African cities have excellent Indian restaurants for example. Always sample the local beer and wine, it's one of the joys of traveling. I have been wonderfully surprised by Rwandan beer, Tunisian wine, and cannot spend a day without chewing on some biltong when in Southern Africa.
Of course you want to avoid any stomach issues as you get used to new spices and oils, so start off slowly. If you are sampling street food, make sure it's cooked well and try to avoid salads and fruits that may be washed with untreated water. More about -- Food and Drink in Africa.
Take a Cooking Course While on Vacation in Africa
There are culinary vacations in Morocco for example that include a stay in a local Riad, shopping in markets for ingredients and lessons from locally trained chefs. South Africa is becoming a culinary destination for foodies from around the world. But you don't have to limit yourself to the haute cuisine of the Winelands, you can also try a one day cooking course in a township. A small Tanzanian safari operator offers a Tanzanian cooking safari, combining wildlife viewing with a chance to practice local recipes.
Many smaller hotels throughout Africa offer a chance for the curious cook to walk into the kitchen and find out how local dishes are made. Exchanging recipes and sharing a love of food is a great way to connect. In Ghana small hotels can arrange a cooking workshop with ladies from a local community. Mixing a little fufu is wonderful way to immerse yourself in the local culture, and build up your biceps at the same time.
More about -- Culinary vacations in Africa.