Having anything up my ass, be it a prostate stimulator, dildo, fingers, or an actual cock, will involuntarily cause me to get an erection. As a matter of fact, when I mentally feel like masturbating but can’t get an erection, I just put a dildo in, and presto, problem solved. But I will say that when I orgasm with something up my ass, I cum with a lot less volume. I think this is because the same muscle movement that causes me to skeet (I’ve always thought of it as "bare down to pee and pull up to skeet") also requires my anal sphincter to clinch.
So if I have something up my ass and my hole can’t close all the way, I don’t orgasm nearly as hard. So when I cum from an actual cock, I usually just dripple cum out rather than shoot it any distance. My tops do love the gripping though! So likewise, when I’m playing by myself, I will usually remove the toy (dildo, prostate stimulator, etc) right before I cum, for maximum effect.