Both refer to the amount of space a container, room etc has to hold things or people.
Therefore, both are correct.
The fuel tank has a capacity of 40 litres.
The room had seating capacity for about 80.
Notice that "capacity for" refers also to someone's ability to do something.
a child's capacity for learning
an infinite capacity for love