Yes. In fact, many OT's work with kids because all boys will get erections but sometimes autistic kids are not aware and may put their hands in their pants in pubic and other inappropriate things. They use picture cards to explain, set boundaries and make rules regarding erections. They are often sensory oriented and the sensation an erection creates is something they seek. Not being aware of surroundings, they then seek this wherever they are. Again, this is very common with autistic kids and something that OT's address in therapy. Not sure why you asked this question, but that is the 411 on autism and erections. :>)
Autism wouldn't prevent most bodily functions from occurring- for instance, unless there is an additional physical issue, an autistic child can urinate just fine. Although they possibly may not be potty trained due to the impulse control signals from the brain that are required for potty training- their bodies would still get rid of waste just like anyone else though.