You can compost some types of wood but it probably isn’t wise to do in a basic garden compost heap.
Since it is a natural product, real wood will decompose into lovely humus – but anything bigger than twigs will take a LONG time to rot down.
In the meantime, it’ll probably clog up your compost heap, making it difficult to turn over and/or extract other finished compost.
If you do want to compost wood (rather than using it/burning it), it would be better to have a dedicated space for it elsewhere in your garden. In the (many) years it’ll take to rot down, it’ll serve as a playground for all sorts of beneficial insects rather than just getting in your way.
Some councils pick up wood (such as large logs or branches) as part of their green waste collection service. Alternatively, people with wood burning stoves will love to get their hands on your wood (ahem) – offer it on a local noticeboard (either offline or online) and someone will probably be able to collect it within a few days.
Hardboard, plywood, particle board and MDF
Fibreboards are almost definitely a composting no-no.
Hardboard is sometimes just compressed wood fibres – that can be composted – but it sometimes includes resin as a binding agent. As it is hard to tell which is which, it’s probably best to leave it out.
Plywood, particle board and MDF always use synthetic binding agents so dust from those should definitely not be added to a compost heap.
Also see: Composting wood shavings and sawdust