Sum-product theorems and applications to homogeneous dynamics