The core of festival etiquette everywhere is remembering you are a guest at someone's celebration, not an audience at a performance. Watch what locals do and mirror it: where they stand, when they fall silent, whether they join the procession or line the route. That observational humility covers most situations.
Dress conservatively unless the festival is explicitly costume-based; for religious festivals cover shoulders and knees, remove shoes where locals do, and keep public affection and alcohol away from sacred processions. Ask before photographing rituals or individuals, and put the camera away during the most solemn moments; you will feel when they come.
Participation varies: at some festivals visitors joining the dancing is welcomed with delight, at others certain rituals are for community members only, so ask rather than assume. Accept offered food or blessings graciously, since refusing can offend. A local friend or homestay host is the best etiquette insurance, and learning a festival greeting in the local language earns enormous warmth.