Rubbing an object can cause it to build up an electrical charge in the object. This happens because the rubbing action can make one object pass electrons to the other. Which way the electrons travel is dependent on which materials you are rubbing together.
A loss of electrons makes an object positively charged,
a gain of electrons makes an object negatively charged.
Opposite charges attract, like charges repel.
So how does the balloon and can work? Have a think...