Use the model numbers of the washer to look up the motor for each model and see if they are the same. If it calls for the same part number they should be interchangeable. Even if they are not the same part number, they still might work. Some of these motors are the same even with different part numbes.
Look at the connections to see if they are the same and also see if they are both the same number of speeds.
Before you do anything, why don't you tell us what your machine's problem is and why you want to change out the motor?