I am changing out my range hood and in the process I realized that my electrical wire will be about a foot short to where I need it to be. Is it ok to just get a piece of wire and extend it using wire nuts? I really dont want to run a whole wire.
You can but put the connection in a steel electric box with a cover and nut and tape the nuts.
Yes, but also tape the wire nuts and installl a plastic junction box to cover the wires. Chances are you store spices and such in the cabinet, better safe than sorry in case of a short.
You have to make all such connections inside an electric box of some kind. It is a code violation to do so and rather unsafe. A good way to do this is to install a metal box inside the cabinet above the range hood and put a regular wall receptacle in the box and then run a wire with a regular plug on it from the hood and just plug it in.
The answer from Gary was basically correct. There is no NEC requirement that the electrical box you use be metal. There are plenty of others out there. If you do use metal, it must be properly grounded. The junction box MUST remain accessible. NEVER bury a live junction box. The receptacle in the upper cabinet is a good idea. If you do this, you can buy a 'pigtail' cord to connect the new hood. This is a cord that has a plug already molded into one end, and exposed wire ends on the other.