Yes, it's not only possible but trivial:
With both iPhone's active on a cellular network, log in to iMessage using the same Apple ID. There may be a short delay "activating" the phone number with Apple servers. You will then see that the active number for each phone is checked, but unselectable (grey). Other registered numbers can be checked/unchecked on the phones, as required, and in settings for the Mac.
Messages (iMessage only, not SMS) can be received on any of your numbers on any device.
Troubleshooting: if the active SIM does not register the number in iMessage, log out of iMessage and then log in again (preferably in an area of good cell coverage).