In this paper, a nonlocal viscoelastic sandwich-beam model is developed to investigate the stability of a pulsating-fluid-conveying carbon nanotube (CNT) embedded in two-parameter elastic mediums. In the new model, thin surface layers are on the inner and outer tube surfaces and both the resulting effects of the surface elasticity and the surface residual stress are taken into account. The classical Euler-Bernoulli beam model is modified by introducing nonlocal and surface parameters. The governing equation is solved via the averaging method and the stability regions are obtained. Numerical examples show the complicated influences of the nonlocal, surface effects and the two medium parameters on the natural frequency, the critical flow velocity and the dynamic stability of the CNT. The conclusions of the present paper may be used in the structural design and vibration analysis of nanofluidic devices.