In this paper, a nonlocal viscoelastic sandwich-beam model is developed to investigate the dynamic stability of a pulsating-fluid-conveying carbon nanotube (CNT) embedding in linear viscoelastic mediums. The classical Euler-Bernoulli beam model is modified by considering the effects of surface elasticity and surface residual stress induced by thin surface layers presented on the inner and outer tube surfaces and nonlocal effect. The governing equation is solved via the averaging method and the stability regions are obtained. Numerical examples are presented to reveal the complicated influences of tube thickness, viscoelasticity, surface effects and two medium parameters on the dynamic stability of the CNT. The conclusions drawn in the present paper are thought to be helpful for the structural design and vibration analysis of nanofluidic devices.