Sometimes it's OK to do this, but often it's considered bad form to leave an event without properly saying goodbye (to at least a few people). For example, modern day etiquette expert Genevieve ...
People sometimes assume that slipping out of a party without saying goodbye is rude. After all, most social etiquette encourages people to thank the host and say their farewells before heading home.