In the US, this is often possible (see the Air Traffic Controllers situation), but I think in many countries in Europe, it's not always legal.
(Police and school teachers have similar requirements in their contracts and will use "sick-outs" to apply pressure without a full strike)