As I am currently in POland, in the last days of an InterRail, it is also astonishing how much these countries have changed since socialism fell down. For urban transit one (still has to) must buy some ticket before boarding and cancel/validate it immediately. Now in those ´good old´ days such tickets were sold by working persons in tiny kiosks and the validating often was by punching some holes in tickets. But those kiosks would close and then it is up to the customer to fetch-it was very, very common to hold some coins and ask any others for an unused ticket-many bought those in packs of 50 or 100.
Except for the need for some form of pre-sale, there are now many more forms to do: machines, apps, other online things on your fone, or grow older and do not pay anymore-just show ID when checked. (that is from 70 and holds for nearly all, but not 100% of POlish urban systems-and also for you, Brits out of the EU). Which also means you hardly have any excuse for being without.
But in general-there is of course no universal rule, D-Martin points it: you will be fined but have to challenge that with some proof to have that cancelled-the burocracy also wants to have its way. In general buying tickets from machines is far from universal and also it seems on the way out: In SE/Sweden this is very much so.
BTW: at Vantaa lento-asema (air-station): as its a common zonal system, machines on/for the trains etc would issue the same tickets for you. As is also most often the case in Germany or Switzerland