This work surveyed the vibration behavior and stability analysis of an underwater moving flexible nanosize beam, implementing numerical and analytical methods as well as tree-based machine learning (ML) algorithms. Dynamic modeling is performed based on the nonlocal stress-strain gradient theory (NSSGT), incorporating variable environmental conditions, surface energy, and rotational inertia effects. The natural frequencies and instability threshold are computed numerically. The exact closed-form mathematical expression for the critical towing velocity of the nanosize beam is determined analytically. Also, decision tree regression and least-squares boosting tree (LSBT) regression algorithms are exploited to predict stability boundaries and the fundamental vibration frequency, and their efficiency is surveyed accordingly. Comparative studies and parametric investigations are conducted. The impressions of geometry, added mass coefficient, scale ratio parameter, surface layer characteristics, fluid mass ratio, humidity, temperature rise, and external magnetic field intensity on the nanosystem dynamics are examined and illuminated. It is detected that the results of the analytical method and ML-based approaches are consistent with those reported by the numerical technique and literature. The results asserted that the proposed ML algorithms have acceptable performance and excellent effectiveness in computational time and cost. It is comprehended that the dynamic features of submerged traveling nanobeams drastically depend on the rotational inertia effects and thickness-dependent scale effects. The stability of the immersed movable nanoscale beams is perceived to improve by increasing the scale ratio parameter and the added mass coefficient. From the perspective of the optimal design of engineering instrumentation tools, the outcomes of the current article can be applied as an inclusive benchmark.