Moving an SSD from a MBP 2014 to a 2015
In short, yes, but there is a caveat. The SSD sticks are transferrable between those two models, no problem.

What you have to be aware of is that as part of any major, and sometimes minor, macOS update, the firmware is also updated. This update, which can be important to have a specific OS version work well on any Mac, obviously does not get applied to the Mac you are transferring the SSD to, just by transferring the SSD.

You must therefore be sure that the Mac you are putting the SSD into either already has the latest firmware, or you must apply it first by running the installation for the version of macOS that is on the SSD you are transferring, on that Mac. You do not have to actually install it on the main internal drive, it is sufficient to in some way do the installation on the Mac in question, for instance by attaching an exteranl hard drive or big enough USB stick, and installing Catalina on that.

Once you have made sure about the firmware, you should be able to transfer the SSD and it will boot. On first boot after the transfer, you might want to hold down the CMD-ALT-P-R key combo so that the NVRAM is flushed and it defaults to boot from the new internal SSD, instead of first looking for the old one.