Olives do compost but they’re not necessarily something you want to throw into your compost heap.
The flesh of the fruit will rot down very quickly but the stones will take a lot longer – if you intend to use your compost in your garden in the near future, the stones might be annoying lumps.
You can read about other things to do with olive stones on How Can I Recycle This?