Can the same Sockets be used when MY2 General-purpose Relays is replaced with MY2N-D2?

Yes, the same Sockets can be used.
MY2N-D2 has coil polarity, so take care when wiring.