Quantum work statistics of linear and nonlinear parametric oscillators