I think the current consensus is that your mind is processing conflicts in your life, but in a symbolic way. The emotions match the conflict, but the concrete factors can be wild. For example, a dream about being in an airplane that's in a nosedive could be about recognizing that you have no control over your current life being destroyed. Perhaps some tragedy struck your life and you feel powerless over it. The cool thing about dreams is that once you recognize it's a dream, you can test solutions to the experience to see what their potential outcomes may be. In the example, the person may recognize that there is nothing they could do, so they decide to peacefully enjoy the last minutes they have. This was actually my recurring dream. When I tried riding it out peacefully, the plane came to a safe crash landing over water, and I was able to gather my most important belongings before the plane sank (it was my dog). We swam to shore, waved at the plane crash goodbye, and walked into the city to start a new life.
Your public shitting and masturbation dreams might be a conflict between what you see as a normal and natural human experience and believing that they are not socially accepted. I think it would be neat to try out different solutions to that drive in your dreams to see how your mind plays them out. You might be able to resolve some ongoing conflict that's been affecting your life.
If you're interested in learning more about dream analysis, look into Irvin D. Yalom. He's known in the fields of psychology and psychiatry for his work on dream analysis. He even has some books where he shares stories about working with clients, interpreting their dreams, and the impact it had on them. Beware tho: the dude was obsessed with death. Anyway, super interesting stuff if you're into that!