What is the wiring of arduino motor shield to Nano?
I believe, though it's not clear, that the shield in question uses a 74HC595 shift register to control the main motor drivers - the other pins are for the servo interfaces (and they are just wired 1:1). Theoretically you can therefore use any pins you like to control the motor drivers themselves.

It's not the same as the Adafruit one which looks to use direct Arduino control of the motor drivers.