They aren't allowed and used under tubs and showers either. They as well as washer drains are and should be p-traps that are vented. You better pull a permit, talk to your local building inspector, and a plumber to help you out. The building inspector is the final authority for your locale. Codes are there to protect any future owners of your home as well as you from yourself.
The reason the toilet can be installed as you describe is because the toilet bowl itself is the trap. Not putting in vents in the proper way will cause your sewage not to flow right down your plumbing and allow for easy backups and especially for a washer which can get a lot of water pumped down it in a hurry and then back out overflowing the top if it isn't vented right.