Neither the word “microwave,” nor the word “rangehood,” nor the two word phrase “range hood” appears in the NEC. I do not know if there is a building or fire code that prohibits what you describe, but it’s in not the NEC.
You could install a cord on the rangehood and plug it in. What type of micro are you talking about? Over the range type almost always requires a rceptacle in the cabinet above the unit as per manufacturers instructions.
I don't think that 422.16 permits you to install a cord and plug on a rangehood, unless the hood was designed and listed for use with a flexible cord. I see no reason not to have a receptacle behind the microware as long as the microwave was supplied with a cord by the manufacturer.
Don