You choose the target when you activate the ability. You don't flip the coin until the ability resolves. Players may respond to the ability, but they won't know the results of the coin flip.
If the permanent or player is an illegal target when Goblin Bangchuckers' ability tries to resolve, it won't resolve and none of its effects will happen. You won't flip a coin and no damage will be dealt.