Are there historical commonalities or is it just a coincidence of history? What practices were shared between the two systems, whether it was coincidental or not?
While they were both elective monarchies, the way both institutions arose is somewhat different. Both are derived largely from ancient cultural traditions where tribes would elect their leader via popular proclamation. The HRE (and the Frankish realm which preceded it) was composed of a number of Germanic realms. The stem duchies of the early Frankish Empire were actually based on ancient tribal lines, and these tribes had to agree when selecting their "King of the Romans" before he could be crowned as Emperor by the Pope.
Polish elections stem from ancient tradition where Piast the Wheelwright, and supposedly his son Siemowit, were acclaimed as rulers. Over time the system became more organized as Sejms were developed where the szlachta could then choose their king, regardless of dynasty.