"In field theory and in modern elementary particle theory, cocycles are used to describe anomalies." (Source)
1-cocycles are used to understand anomalies in the Lagrangian framework. The 1-cocycles show up in the non-conservation of classically conserved currents.
2-cocycles are used to understand anomalies in the Hamiltonian framework. They have the effect that it becomes impossible to satisfy Gauss' law. (Source)
For a great introduction see https://inspirehep.net/record/213998/files/v15-n3-p99.pdf and chapter III in Analysis On Infinite Dimensional Manifolds: Schrodinger Representation For Quantized Fields by R. Jackiw