When it comes to AC electricity, polarity is less important. You can actually rip the grounding pin out of most plugs and plug it in upside down and most devices should work; Although it can make things more dangerous, as this often times places the power switch at the end of the circuit, instead of at the start (This means the entire circuit is energized, but it just doesn’t have a ground yet).
In the case of DC powered electronics, most use switch-mode power supplies, which do not care about polarity. This includes phone chargers. If polarity matters to an electronic device, the manufacturers will use a polarized plug. In the US and Japan, the neutral blade of the plug will be larger, preventing people from plugging it in the wrong way.