Could prostatitis cause pain in the opening of my penis?

YES. but more likely to be urethritis or a UTI. I suggest a urine culture and analysis, abstaining sexulally, avoid oral and vaginal stimulation.If having unprotected sexual intercourse or multiple sexual partners , I suggest a comprehensive STD screen.
Yes. Having prostatitis can cause a variety of urinary symptoms including perineal pressure, burning or discomfort with urination including the opening to the penis, and urinary frequency.
Yes. Depending on the cause and severity, any inflammatory or infectious process involving the prostate is commonly associated with pain in the region of the head (glans) of the penis as an example of “referred pain” related because of similar nerve pathways. .