I don’t know if they can be used, but they shouldn’t. Recently, sun exposure is considered more and more harmful to the skin. This is why for recommended Vitamin D levels, no sun exposure whatsoever is usually assumed, and only intake via diet considered.
Because ultraviolet rays from the sun and tanning beds can cause skin cancer, the American Academy of Dermatology does not recommend getting vitamin D from sun exposure or indoor tanning.
Source: American Academy of Dermatology