Communication between arduinos over 4 interchangeable pins

but the communication MUST be possible even if we interchange the connections.

Does that mean any pin can be connected to any pin? If that's true, is it a must that both Arduinos run the same sketch, so they are interchangeable too?