Common Ancestry of ETCs and ATP Synthase complexes
Rickettsia and Cyanobacteria are not part of a small clade that share these features.  ATP synthases are present across all domains of life, and they are all homologous, i.e. derived from a common ancestor.  The means its fairly likely that the last universal common ancestor had some form of ATP synthase.

ETCs and ATP synthases are part of the chemiosmotic theory put forward by Mitchell.  Whats beautiful about this mechanism is that you just need a single ATP synthase to make your energy, and it can be used regardless of your metabolism, be it a Cyano or a Rickettsia.  All you need to do is somehow couple your metabolism to a proton motive force across your membrane, and then you just let the protons fall back down their electrochemical gradient, powering the formation of ATP.

Organisms from all corners of the tree of life use this strategy, so this is not some special common feature linking the organisms that ultimately became eukaryotic organelles.  Its worth noting that there are alternatives to ETCs and proton motive force-based ATPases, you can make ATP by substrate-level phosphorylation like in fermentation metabolisms.