In Brazil, each voting machine is sealed off, air gapped. The only attack vector is in transit, when the votes for each machine are being transmitted to the regional electoral center, which then announces its results for the region. So it is possible to scale an attack if you somehow had the actor had access to the data in transit and was able to decode, tamper and sign the results again before reaching the regions servers. This for each region.
So yeah, while it is possible, I don't think this scales as well as people would think. No election in Brazil had any proof of tampering up to this day. Take that as you may, you can attack me personally, you can question the government's data, you can put in check how we even audit the system, but in decades of the system there isn't any hard evidence of large scale compromise of the electoral system.
Having said all that, I think all this talk serves more as a smoke screen for more pressing issues of large scale social manipulation through social media and fake news. My question then is why would anyone in their right mind attempt to compromise the electoral system itself if it is so much more effective to just manipulate public opinion by jeopardising traditional media trust, flooding message systems with fake news sources, use prominent political figures to spread anti-democratic ideas and leverage social media algorithms to radicalize voters?
Anything that doesn't do that (even electronic counting of paper ballots) cannot be trusted.
Videos - https://youtu.be/LkH2r-sNjQs?si=INtv6_sr7_V5oxh7 (3 years old) & https://youtu.be/w3_0x6oaDmI?si=vwx5xpqX3i1SVqVN (8 years old).
(Maybe excluding the “use electronic machines for quick results and have paper votes to for a slower, “official” result” argument.)