Dakar is the capital of Senegal.
Although the city can seem quite chaotic at times, as most big cities do, Dakar actually has a very well-connected bus network. There are several different bus companies, the major ones seem to be the public bus company "Dakar Dem Dikk" and the smaller "Tata" buses. There is even a website/app, which allows you to calculate the best connection to your destination.
Take Tata bus 64 or 68 to Diamniadio, where the road splits and you can hitchhike towards either Thiès or Mbour.
The-nomaddicts took bus 66 to Rufisque and got a ride easily with a lorry truck, which took us outside of the urban sprawl. Be sure to leave as early as possible because traffic is insane. We took the first bus out of Patte D'Oie at 6 am and by the time we got to Rufisque (around 8 am) the buses leaving the city were already packed.
It should be possible to camp somewhere up on the hill on the island of Goree, where there are quite a few tourists during the day, but the atmosphere is otherwise very relaxed with enough space in the bushes for a tent, friendly locals and it is definitely not crowded. The cost of the ferry (5200 FCFA return trip for non-African non-residents) would make it quite the expensive night if you're just looking for a place to sleep (you could pay for a room with that amount), but if you're planning to visit the island anyway, which is definitely worth it, it could be a good option. The people are generally very friendly and there are a lot of artists and small galleries.