In the UK the rules depend on the good or service in question, the price and whether the good or service has been downloaded, used, opened or such.
Assuming the seller has provided no information about which law applies to your purchase (your contract) - which depending on the circumstances may be an offence - perhaps first look at The Consumer Contracts (Information, Cancellation and Additional Charges) Regulations 2013 and "the limits of application" in sections 6, 27 and 28.
If the Consumer Contracts regs don't apply to the good or service your contract is about, don't take it as read that there is no right to cancel or cooling off period or such - another rule may apply. For example there is a 14 day cooling off period for insurance contracts made online and you could consult the FCA handbook for information about that rule.
Which? magazine and the UK's citizen's advice organisations offer good guidance about UK consumer rights. It seems infeasible to give a comprehensive answer here about all goods and services and circumstances.