Does iMessage work internationally with only a number?
Yes, you can still use iMessage in this case.

The phone number used in country A is registered with Apple's servers, so when you use iMessage to message that number, they'll send the message to the devices logged in to iCloud with the account that has that phone number registered for iMessage.

Your friend can register multiple such numbers, and from the Settings =&gt; Messages on his iOS device choose which numbers to actually use for sending and receiving.

If your friend does not want this to be possible, he needs to deregister his phone number from iMessage. He can do that by following this guide from Apple.