link between two Arduino cards

Can I send from a numeric pin (OUTPUT) of one Mega Arduino to a numeric pin (INPUT) of a second Mega Arduino, without problem for the 2 cards ?

Thanks for help me

Yes, if it means that you connect p.e. D4 of Arduino 1 to D6 of Arduino 2 and configure Arduino 1 D4 as an output and D6 of Arduino 2 as an input.