PSA: It’s possible to move a MacBook Pro notebook SSD drive to another similar model of the same year, with two exceptions:
1) the new computer needs the firmware for that filesystem version. For example, if the SSD used APFS (10.13 and later) and the target computer used only HFS (10.12 and earlier), then it will not boot or even recognize the volume.

The dreaded Mac question-mark folder icon. It indicates no boot device was recognized.
2) The new computer also needs the same level of other firmware (EFI) to boot. Otherwise, you’ll see the “folder with a question mark icon” upon boot, and when using the Disk Utility startup menu, you will not see the SSD drive (just an empty startup options list.)
Also, if your App Store account does not have a linked payment method, the highest version of Mac OS X that can be downloaded is High Sierra, as of July 1, 2019. (No Mojave for you!)
support.apple.com: File system formats available in Disk Utility on Mac