An electrochemical process for preparing a compound comprising a metal or metalloid and a peroxide, ionic or radical species