The 15" Mid-2015 MRBP uses an 8.0 GT/s PCIe x4 card; the 13" Mid-2014 MRBP uses a 5.0 GT/s PCIe x2 card. The 15" card might work in the 13" laptop; the 13" card probably won't work in the 15". The sockets are the same layout, but the roadway behind them is different.
Generally, drives or RAM with physically compatible pin layouts are backwards-compatible; a faster drive will scale down to a slower bus speed, but the system won't work with components slower than those for which they were designed.
That said, the aftermarket retailers of third-party SSDs for late 2013+ Macbook Pro Retinas and Macbook Airs (basically, [https://eshop.macsales.com/item/OWC/SSDAB2MB10|OWC]) list identical cards for MBRPs (both sizes) and MBAs (both sizes) - the same cards fit in all models. In the earlier 2010-early 2013 era, Macbook Pro Retinas and Macbook Airs used different cards (and 2010-2011 MBAs used different cards from 2012 MBAs).