We consider the nonlinear dynamics of a single vortex in a superconductor in a strong rf magnetic field ${B}_{0}\phantom{\rule{0.2em}{0ex}}\mathrm{sin}\phantom{\rule{0.2em}{0ex}}\ensuremath{\omega}t$. Using the London theory, we calculate the dissipated power $Q({B}_{0},\ensuremath{\omega})$ and the transient time scales of vortex motion. For the linear Bardeen-Stephen viscous drag force, vortex velocities reach unphysically high values during vortex penetration through the oscillating surface barrier. It is shown that penetration of a single vortex through the ac surface barrier always involves penetration of an antivortex and the subsequent annihilation of the vortex-antivortex pairs. Using the nonlinear Larkin-Ovchinnikov (LO) viscous drag force at higher vortex velocities $v(t)$ results in a jumpwise vortex penetration through the surface barrier and a significant increase of the dissipated power. We calculate the effect of dissipation on the nonlinear vortex viscosity $\ensuremath{\eta}(v)$ and the rf vortex dynamics and show that it can also result in the LO-type behavior, instabilities, and thermal localization of penetrating vortex channels. We propose a thermal feedback model of $\ensuremath{\eta}(v)$, which not only results in the LO dependence of $\ensuremath{\eta}(v)$ for a steady-state motion, but also takes into account retardation of the temperature field around a rapidly accelerating vortex and a long-range interaction with the surface. We also address the effect of pinning on the nonlinear rf vortex dynamics and the effect of trapped magnetic flux on the surface resistance ${R}_{s}$ calculated as a function of rf frequency and field. It is shown that trapped flux can result in a temperature-independent residual resistance ${R}_{i}$ at low $T$ and a hysteretic low-field dependence of ${R}_{i}({B}_{0})$, which can decrease as ${B}_{0}$ is increased, reaching a minimum at ${B}_{0}$ much smaller than the thermodynamic critical field ${B}_{c}$. We propose that cycling of the rf field can reduce ${R}_{i}$ due to rf annealing of the magnetic flux which is pumped out by the rf field from a thin surface layer of the order of the London penetration depth.