If commercial airliner cabin is depressurized, are pilots protected against it in any ways?
No, the cockpit is not separately pressurized. That would be impractical and not particularly useful.

However, pilots do have oxygen masks, just like the passengers. Unlike the passenger masks, these masks are generally designed to be donned extremely quickly, with one hand (they tend to have automatic straps that clamp on without needing to be manually adjusted). The masks also have a separate oxygen supply from the passenger masks, and have much more oxygen available for each mask, and have other nice features. Furthermore, when one pilot is off the flight deck, the other wears an oxygen mask that's either releasing oxygen or set to automatically do that if the plane depressurizes.

If sudden depressurization happens, there are still a few seconds of useful consciousness for most people. That time is enough for airline pilots to put on their masks. Once the crew has on oxygen masks, they can control the depressurized plane just fine (depending on how it depressurized, of course: if the tail broke off, there's not much that can really be done).