Many European countries have enacted laws prohibiting smoking on trains and severely restrict smoking in train stations. Smoking is not permitted on trains in the vast majority of countries in which a Eurail pass is valid, though in some countries it's more heavily enforced than others.
When in doubt, ask a ticket seller to make sure you're getting a seat in a non-smoking section if that's your preference. Keep in mind that in some countries, despite a law that prohibits smoking, many still smoke on trains and officials do little or nothing to stop them. This isn't the case in most of Europe, but in some places it's a lingering problem.
Smokers should not count on being able to smoke on board trains, and that includes in the dining cars and train lavatories. In train stations, there are typically designated smoking areas which, again, might not always be enforced to the same degree in every country.