A study back in 1974 reported that vit. D in milk was unaffected by pasteurization, boiling, or sterilization.
Hartman, A. M., and L. P. Dryden. 1974. Vitamins in milk and milk
products. Pages 325–401 in Fundamentals of Dairy Chemistry.
2nd ed. B. H. Webb, A. H. Johnson, and J. A. Alford, ed. AVI/
Van Nostrand Reinhold, New York, NY.
Hartman, A. M., and L. P. Dryden. 1974. Vitamins in milk and milk products. Pages 325–401 in Fundamentals of Dairy Chemistry. 2nd ed. B. H. Webb, A. H. Johnson, and J. A. Alford, ed. AVI/ Van Nostrand Reinhold, New York, NY.
Different cooking methods for other foods can alter the D content but not drastically it seems. (https://pubmed.ncbi.nlm.nih.gov/29548435/)