You are referring to the "slam" feature built into many machine games. When you hit a payout of any kind, you can hit the play (or spin) button on machines where this feature is enabled and the credits will either tick up faster or post immediately. Most machines have this as an option, but the casino's slot director can override it if he chooses. On games where this feature is not enabled, you can bang the buttons until the cows come home and it will not affect the speed.
Is there anything wrong with doing it? Yes and no. Hitting the slam will in no way affect future results on the machine. However, banging the buttons can be annoying to other players, which could be one reason for counseling against it. A much better reason for avoiding it is that hitting the slam forces you to play faster, which is bad in the long run if you're playing a negative-expectation game. If bankroll preservation is your goal, you should play as slowly as possible when playing games where the casino has the edge (most of them). Therefore, you shouldn't use the slam on slots, because the net result of playing faster is that you will lose more money. Unfortunately, impatient and compulsive players get caught up in the winning or losing of a session and tend to use the slam feature whether they have the advantage or not. Casinos like that.
On the flipside, using the slam is an intelligent strategy when you have the edge. Expert video poker players, for example, who find and play games where they have the advantage, frequently use the slam after every win so they can play the most possible hands in good situations.