framing a garage
Generally a 30 inch door requires a 32 inch opening.
They also just use 2x12 headers because a 2x12 is the correct spacing for the header above the door. You could use a 2x8 header but then you have to measure where it goes.
For the garage door, just measure it out while building the wall.
normal for swing doors is 2-1/2" over nominal width and height.
Frame the garage door at the nominal size of 9x7. Use 2x4 with a double jack under each end of the header. Header size depends on what it is supporting. Your roof might not bear on this wall the garage door is in, but if it does, the generall rule of thumb for opennings is to use a double 2x6 for up to six foot openning, 2x8 for 8', 2x10 for ten foot, etc.
So if you are using an eight foot tall wall, a doubled 2x10 will be just right after you alow three inches for the double top plate and have a 9.25" 2x10. That leaves an openning of 6'11.75" before trimming out the door.