Zeroth-Order Machine Learning: Fundamental Principles and Emerging Applications in Foundation Models