No the problem is the sun has to hit the earth's atmosphere at a certain angle in order for the correct wavelengths of light to pass through the earth's atmosphere. The amount of Vitamin D your body can generate from sunlight is based on your skin tone, where you are, the time of day, the day of the year, and the angle of the sun at that time and place.
Above/Below a certain latitude (N/S) there is a window of time where the sun never hits that angle at any point during the day, so you could sit outside naked all day long and still get zero vitamin D.
If this seems counterintuitive consider if you keep going far enough away from the equator and get into the arctic/antarctic the winter has no sunlight at all, and you clearly can't produce Vitamin D from sunlight if the sun never rises.