If you’ve got more than one domain (such as example.co.uk, example.uk, example.io etc.) that you want to be redirected to the same site (example.com), then it can easily be configured using Cloudflare’s PageRule functionality.
This guide assumes you’re already using Cloudflare’s services for all the domains to be redirected and have caching/performance enabled (i.e. not DNS only). If not, go follow this guide from Cloudflare