Dynamical Casimir effect via modulated Kerr or higher-order nonlinearities