Over 90% of vitamin D comes from sunlight, leaving only 10% from diet. People with white skins living northern Europe only need about 15 minutes of sunshine on face & hands to get enough vitamin D. So, the main risk of vitamin D insufficiency is in people with darker skins living in higher latitudes, particularly those who don't go outdoors much, and those whose faces & hands are covered when they go outside. As it's a fat soluble vitamin, it is possible to overdose by taking too much in diet or oral / injectable supplemnts. As with most things, insufficent vitamin D increases chances of developing diabetes (both types 1 and 2), but people with adequate vitamin D levels are not immune (I was diagnosed in March, at the end of a southern hemisphere summer, having been outdoors virtually constantly since leaving UK in May) and those who have inadequate vitamin D might not get diabetes either.
So, vitamin D is just part of the very complex story of developing diabetes. Personally, I think the health benefits of sunshine (NOT getting burned) in terms of physical activity, improved mood etc means it's essential.