What is the rating of the circuit breaker which protects that circuit? Your conductors and plugs should be rated at or above the rating of the circuit protection.
You can do a hard wired cord, but is there a reason you don't just put a twist lock plug on the wall and then make up a cord?
For a cord, you should use flexible cord and not romex. SOOW or SJOOW are what I would recommend for making a cord. They are going to put up with use and abuse, whereas romex type cable is intended to be in protected spaces and is not intended to be used as flexible cable. The insulation just will not hold up.
30 amps, plugs and socket are rated for 50... Good point on the romex cable too, it's a thin jacket...
I think I might run some conduit and a new plug from the main breaker panel to a better spot in the garage...
