Digital output from one nano to digital input of another.
Yes, you can. As you noted, you do need to connect the grounds of both Arduinos. 

For some extra protection you could put a resistor between the output and the input. For example a 1kOhm. That way, if you accidentally set both pins as outputs, or plug the wire in the incorrect pin, you won’t get a dead-short.