I would suggest the OP starts with - what is most important for him? If it is safari then I would suggest concentrating on that, if it is desert, then concentrate on that. It is possible to do both - idea below, but just worried it would end up being more time spent driving than anything else.
Namibia has decent tar roads north and south with a couple of spokes. The rest are mainly decent gravel roads. As ChiefNWA says, the roads are good unless it has rained. In theory when the OP is there, it should be just before the rains have started, so should be ok.
I would also ask, is the OP flying in WDH from South Africa or arriving from a long-haul flight? If arriving from a long-haul flight, I would strongly suggest the first night in Windhoek or surrounds. While the quality of Namibian roads is generally not bad, especially when it comes to the gravel roads, you do not want to be driving on them when you are tired.
If coming from South Africa then no real problem - Sossusvlei is reachable on the day of arrival - assuming that you get away by 13:00 you should reach Sossuvlei well before sunset.
One night is enough if all you want to do is just see the dunes. You will want to be at the gate to get your permit before dawn (sunrise set for 06:26 on the 12th October) and be into the park to catch the dunes at their best, as the sun rises. It would be a shame to go all that way and just see the main drag - would highly recommend going all the way as far as Dead Vlei. To do this properly you would probably not exit the park much before midday. This would give you enough time to reach Swakopmund by late afternoon (without much stopping en route).
There are some nice things to do from Swakopmund - Sandwich Harbour, a living desert tour etc - but they might not be everyone's cup of tea.
From Swakopmund (assuming you just use it as an overnight stopover) you could push on the next day - and realistically leave 6 - 7 hours to get to the Anderson gate at the southern end of Etosha. You could then spend the nights of the 20th and 21st in Etosha and morning of the 22nd, then head part of the way back south. If the flight leaves at 14:00 from WDH, you need to be back by 12:00 - so you really need to have reach the other side of Windhoek by 11:00 - all doable from Etosha, if absolutely nothing goes wrong.
October is peak season for travel in Namibia, and many places will be fully booked - but you should still find some last minute cancellations.
Personally - I would do either a 5 night Windhoek - Sossusvlei - Swakopmund - Game Lodge (Omaruru area) - Windhoek - even that would be a lot of driving.
Or head north and do - Windhoek - Etosha - Damaraland - Windhoek.
By late October, Etosha is very dry and the game concentrates around the waterholes, making it some of the most amazing game viewing in Africa. If you can find anything at Okaukuejo Restcamp, that would be like the holy grail (IMHO) at that time of year.
Having said all of that, whatever you do, I really hope you love Namibia, it is a great country.