Sure. Of course, I also get an erection when someone walks past my office door, or when the phone rings, or when I look out the window and see that the weather has changed. Draw your own conclusions.
I don’t mean to imply that a full bladder is the only factor, just that there is no reason it can’t be a contributing factor. Why don’t we get erections every time we have a full bladder? Perhaps for most people it is a weak influence that can only manifest in the depth of relaxation that only occurs during sleep. For me it is a strong influence; in fact sometimes I get waking erections in response to a full bladder and nothing else. And no, I haven’t obtained a research grant to study this, but I have lived long enough to be familiar with how my own plumbing operates.