Anomalous diffusion plays a crucial rule in understanding molecular-level dynamics by offering valuable insights into molecular interactions, mobility states and the physical properties of systems across both biological and materials sciences. Deep-learning techniques have recently outperformed conventional statistical methods in anomalous diffusion recognition. However, deep-learning networks are typically trained by data with limited distribution, which inevitably fail to recognize unknown diffusion models and misinterpret dynamics when confronted with out-of-distribution (OOD) scenarios. In this work, we present a general framework for evaluating deep-learning-based OOD dynamics-detection methods. We further develop a baseline approach that achieves robust OOD dynamics detection as well as accurate recognition of in-distribution anomalous diffusion. We demonstrate that this method enables a reliable characterization of complex behaviors across a wide range of experimentally diverse systems, including nicotinic acetylcholine receptors in membranes, fluorescent beads in dextran solutions and silver nanoparticles undergoing active endocytosis.