I am a Nikon user and my friend uses Canon. If we use Yongnuo YN-622N & YN-622C can we trigger both the Nikon and Canon flashes at the same time?
No, you can't.
To quote from v5.0 of The Other YN-622C User Guide II, page 20:
The Canon YN-622C is NOT compatible with the Nikon YN-622N. The camera codes are not the same.
This actually makes sense when you consider the completely different pin/contact arrangement on the hotshoe and the inevitable differences in signal protocols.
The only way I could theorize that you might be able to get YN-622 gear to work between both systems might be if you switched all the gear to 603 compatibility mode, or tried using the legacy mode that mirrorless shooters use, but then, of course, you'd lose all the added TTL/HSS/remote commanding capability of the 622s across systems.
Manual triggers, like the RF-603 II/YN-560-TX/YN-560III-IV/YN-660 combo might work, but you'd want to be sure that whatever unit you put onto the camera as the on-shoe transmitter is compatible with the specific camera body (check the pins on the foot).