Quasi-geostrophic dynamics of an ellipsoidal vortex embedded in a nonuniform flow is studied in the approximation of the infinitely deep rotating ocean with a constant buoyancy frequency. The vortex core is an ellipsoid with a constant vorticity different from the background vorticity value. The core is shown to move along with the flow and to deform under the effect of it. Regimes of the core's behavior depend on the flow characteristics and the initial values of the vortex parameters (the shape and the orientation relative to the flow). These regimes are (i) rotation (along with the eccentricity oscillation), (ii) oscillation about one of the two specific directions (along with the eccentricity oscillation), and (iii) infinite horizontal elongation of the core. The localized regimes (rotation and oscillation) of the core motion are analyzed. It is shown, that zones of the water mass capturing can appear in the induced velocity field. The mechanisms of fluid particle trajectory chaotization are revealed; in particular, it is shown that, owing to the double periodicity of the core motion, all the nonlinear resonances appear as pairs of two resonance islands with the same winding number.