Legal and socially acceptable are two very different things when it comes to smoking. In some countries cafes still have smoking terraces and nobody blinks, while in others lighting up on the street earns you open disapproval even where it is technically allowed. Attitudes have shifted toward non-smokers almost everywhere in the last decade.
A few etiquette basics travel well. Never smoke around children, in queues, at bus stops or near building entrances. Ask before smoking at an outdoor restaurant table, even if others are smoking. Do not flick ash or butts on the ground; in many cities littering a cigarette butt carries its own fine, and locals genuinely notice it. Portable ashtrays are common courtesy in places like Japan.
When visiting someone's home, wait to be invited to smoke or step outside on your own initiative. Watching what local smokers do is the fastest way to calibrate: if they cluster in one corner away from foot traffic, join them there.