This circuit will try and apply a 3.3V signal to the fan pin 2, but as previously noted, without knowing anything about the fan, whether that will actually achieve anything is anyone's guess. Also, if the fan pulls up its pin 2 above 3.3 V, you're going to pull the Pi's 3.3 volt line up too, which might damage it. (Not knowing anything about the fan, I don't know whether it will pull it up, or how high it will pull it, but I note that a standard PC 4-wire fan will normally pull the PWM line up to 5V or so, if it can).
If you're trying to get a PWM higher-current drive than direct on the Pi GPIO, I'd use the first circuit, remove the diode and add a resistor pulling up to whatever the fan needs (standard 12V PC fans notionally require a 5V PWM, but they are normally very tolerant of that so 3.3V would work). If the fan has its own internal pull-up you don't even need the resistor - just take the diode out.
But as stated - if it's a 3-wire fan, it probably doesn't have a PWM control line. If it's a 3-wire fan, it's probably the case that you can't control it from teh third wire.