Is vitamin D safe to take in supplement form?
The short answer to your question is "yes".
The long answer is slightly more complex. When used at safe, doctor-recommended levels, vitamin D is safe to use in supplement form.
There are some complexities however. Vitamin D3, or cholecalciferol (the sunshine form of vitamin D) is going to be absorbed much more effectively than D2, or ergocalciferol would be. While ergocalciferol was a popular supplement at one point, that is no longer the case, as most supplement manufacturers only make D3 now.
There is also a phenomenon known as vitamin D toxicity, in which a person can ingest too much vitamin D. However, this is very rare and in the few documented cases of it actually occurring was the result of poor manufacturing techniques years ago that resulted in the dosage being substantially higher than was labeled. Supplement manufacturers have come a long way since then to ensure the dosages listed on the label are consistent with what's actually inside the pill or capsule.