This would be my analysis of what happens. In the first sketch the FORCE on the diaphragm (air pressure times diaphragm diameter) must match the FORCE on the needle (oil pressure times needle exposed area). When the force on the oil side becomes greater it lifts the needle, relieving pressure until force on the needle becomes lower than the force on the diaphragm and the needle seats again. I'm not clear on the function of the bleed hole on the air side. If air pressure can't be controlled then a small needle valve for air could allow some control, otherwise it just means lost (waste) air.
In the second instance, essentially nothing changes except that the piston is interposed. Unless the diaphragm is smaller than the piston, the relationship between air pressure and oil pressure will remain the same.
Boslab's reference to a spring references another regulation mechanism. If, instead of air pressure against the diaphragm, you had a spring with a screw adjustment for spring pressure you'd have another mechanically adjusted oil pressure regulator. This arrangement is fairly common.
And you can have both a spring and air pressure. This arrangement might show up in a fuel pressure regulator for a turbocharger system in which the carburetor is inside a plenum with boost pressure applied. A spring regulator sets basic fuel pressure, but when boost starts, this boost pressure is added to the float bowl and opposes fuel pressure so fuel flow will be reduced and eventually stopped. However if a small line is run from the plenum to the spring side of the regulator it will ADD its pressure to the fuel to make sure that the fuel always has its set pressure above boost. And conversely, when the plenum is at atmospheric pressure, the fuel pressure is controlled only by the spring setting.
.
"I am often asked how radio works. Well, you see, wire telegraphy is like a very long cat. You yank his tail in New York and he meows in Los Angeles. Do you understand this? Now, radio is exactly the same, except that there is no cat." : Albert Einstein