Can pilots smoke in the cockpit of an airliner?
All of the most significant countries prohibit smoking on airline flights, either through national, industry, or airline regulations. This applies to crew through different regulations, but as strictly as to the passengers.

Pilots can and sometimes do smoke in the cockpits of business jets. These can be as large as airliners (see BBJ), but usually aren't.