Truth to be told, the best thing for SEO is to build a site from scratch in some javascript related framework like React or Angular as here you would have the chance to customize everything as you wish, and these sites usually don't reload while going from one page to another so they have an amazing loading speed. But, if you refer to CMS, they are all pretty much pre-optimized for SEO which means that they already compress images, have decent performances, and so on. WordPress probably just has the best plugins from them all.