at my airport we try waving first to grab the flight deck's attention then failing that we do bang on the side to grab attention about three times to say that the GPU is good to disconnect for example.
As far as I am aware there are no rules forbidding this but I think that this falls down to the individual Ground Handling Agent and then ultimately the airline to say if this is ok, or not according to the relevant SOPs.
Two of the airlines that we handle both operate ATR72 type a/c. One of them forbids banging on the side of the a/c to get the captain to open the access flap in the flight deck. The other, doesn't say anything about if its ok or not, so we do!