Connecting headphones to mcu
While this is a less authoritative answer than I prefer to give, frankly, yes, that should work.

There are many projects where a speaker is directly connected to a microcontroller through just a resistor. The Arduino Tone library and Tutorial is one such example. The Arduino uses an Atmel ATMega328 (or similar), with a similar current limit (40mA, with voltage droop). The example/recommended setup is an 8Ω speaker connected with an 100Ω resistor. While speaker Impedance is not the same type of Ohms as DC Resistance, the combination of greater impedance of your headphone speaker (Typically 16-32Ω) and higher limiting resistor (300Ω as you mentioned) should be enough to both produce sound and protect the Pic's output pin.

Most often, a DC blocking capacitor is not needed in these limited situations.

Then again, this is my educated guess.

The other option is using a single npn transistor for the speaker. This might be sufficient if a direct connection is not.