Never tried this but I suppose it would be very difficult if not impossible to pee during anal sex. I'd rather try to pee through a speculum if I knew somebody who is into this.
Peeing while inside someones ass is difficult, but no where near impossible. It takes a lot of concentration! That first time your mind just knows its 'wrong', ie you are semi hard, with a tight 'ring' around your cock, maybe laying down and not in front of a toilet! It might be analogous to the 'shy bladder' that many people experience in public bathrooms, or in front of somebody. But if you just relax, don't move at all, clear your mind and concentrate to let those muscles go, you can do it. Not moving is important so that your hard-on can subside a bit to open the valve. But after that first time, it gets easier and easier, until you can do it anytime, anywhere. Practice makes perfect!
As for using a speculum - don't unless you want a mess. A speculum or funnel is never good for filling the anus. You will get a few ounces into the rectum, but then the rest will overflow. You need pressure to get more liquid in an ass, that's why enema bags have to be hung a few feet above the anus. The weight of the water will force it past the rectum and into the colon, just like the force from a Higgonson bulb syringe, or the force from peeing. It doesn't take much pressure, but it does take some, and filling an 'open hole' (ie speculum or funnel) doesn't have any.