All NPN transistors work the same way?
There are two ways to see whether one transistor will substitute for another in a specific application.

1) Compare the transistor ratings
2) Compare the new proposed transistor with the application requirements

Even if the second transistor is inferior to the first, if it meets the requirements of the application, it will still be OK.

In your specific case, let's compare those two transistors 2N5551 and BUF654

parameter    BUF654    2N5551

power 25C    80W       625mW


there's a big difference before we look at anything else!        

max VCEO     400V      160V
max IC       12A       600mA


I don't think we need to compare any more. You're probably going to need a bigger boat. The 2N5551 is definitely inferior to the BUF654. 

However, it may still be big enough for the application. It may be a really tiny motor, drawing only a few hundred mA, and the circuit switching PWM, rather than burning power to control it. In which case, the 2N5551 may be OK.