Detecting gravitational waves from coalescing compact binaries allows us to explore the dynamical, nonlinear regime of general relativity and constrain modifications to it. Some of the gravitational-wave events observed by the LIGO-Virgo Collaboration have sufficiently high signal-to-noise ratio in the merger, allowing us to probe the relaxation of the remnant black hole to its final, stationary state---the so-called black-hole ringdown, which is characterized by a set of quasinormal modes. Can we use the ringdown to constrain deviations from general relativity, as predicted by several of its contenders? Here, we address this question by using an inspiral-merger-ringdown waveform model in the effective-one-body formalism, augmented with a parametrization of the ringdown based on an expansion in the final black hole's spin. We give a prescription on how to include in this waveform model, the quasinormal mode frequencies calculated on a theory-by-theory basis. In particular, we focus on theories that modify general relativity by higher-order curvature corrections, namely, Einstein-dilaton-Gauss-Bonnet, dynamical Chern-Simons theories, and cubic- and quartic-order effective-field-theories of general relativity. We use this parametrized waveform model to measure the ringdown properties of the two loudest ringdown signals observed so far, GW150914 and GW200129. We find that while the Einstein-dilaton-Gauss-Bonnet theory cannot be constrained with these events, we can place upper bounds on the fundamental lengthscale of cubic- (${\ensuremath{\ell}}_{\text{cEFT}}\ensuremath{\le}38.2\text{ }\text{ }\mathrm{km}$) and quartic-order (${\ensuremath{\ell}}_{\text{qEFT}}\ensuremath{\le}51.3\text{ }\text{ }\mathrm{km}$) effective-field-theories of general relativity, and of dynamical Chern-Simons gravity (${\ensuremath{\ell}}_{\text{dCS}}\ensuremath{\le}38.7\text{ }\text{ }\mathrm{km}$). The latter result is a concrete example of a theory presently unconstrained by inspiral-only analyses which, however, can be constrained by merger-ringdown studies with current gravitational-wave data.