Scrod's got it kinda backwards but Jackman, nope.
You can go up to a Detroit, out of gear, and ram the throttle wide open. It will go to the high RPM limit ("high idle") and no more.
Do that on a gas engine and it will disassemble itself unless it has a rev limiter in the electronics somewhere.
When you set a throttle position on a diesel with a variable speed governor (as is found on a boat) you are selecting an RPM, not a power level. The governor varies the fuel flow to achieve the RPM you selected. If the RPM selected is not achieveable because thee engine cannot produce that much power then obviously the RPM will not be achieved, but otherwise, it will be and fuel will be modulated as required to maintain that RPM level.
This same sort of governor arrangement is used with diesel generators, and is typically set for 1800 RPM. The governor holds the engine at 1800 RPM irrespective of load (within the engine's power output capability, of course.)
This is very different than what happens with a gasoline engine where you modulate airflow with the throttle and the computer (or carbuerator) meters fuel to meet the airflow setting you have selected.
If you take a gas engine at part throttle and take the engine out of gear, it will race (and may explode due to overrev.) If you take a diesel at part throttle out of gear the RPM will not appreciably spike.
This sort of governor is not used on diesels in road applications because it would make driveability very difficult; in road applications on a diesel you have what is called a "limiting speed" governor which operates far more like a gas engine throttle in practice (you are selecting a power level rather than an RPM) but with a cap on the RPM the governor will permit to be achieved.