In Dakar there are public & private beaches. Private are usually propoerty of hotels or clubs so you have to de a guest to enter; or pay a small fee. In public beaches you can go free.
Usually, private beaches are better equiped and used by white people, while in public beaches you will find more locals.
If you go have lunch to the Lagoon 1 restaurant, you can take a swim and sunbath while you wait for the food (or after the dessert). The restaurant is located at a pier in the Corniche, and you can swim there.