The ability of Hamlet Captain that gives other humans +1/+1 is a triggered ability that uses the stack and can be responded to. This ability triggers when the Hamlet Captain attacks or blocks, regardless of whether or not you control other human creatures. When it resolves it will give other humans controlled by the Hamlet Captain’s controller +1/+1 until the end of the turn. This bonus is given to all human creatures controlled by that player, even those that are not attacking or blocking.
As mentioned above, this ability uses the stack and can be responded to. However, even if the Hamlet Captain is no longer on the battlefield, the ability will still resolve and other humans controlled by that player will still get +1/+1. This is because once an ability is on the stack, it exists independently of its source and will resolve even if the source of the ability leaves play.
For example, let’s assume that you attack a player with two Riot Devils, and your opponent blocks one with a Hamlet Captain and the other with a Mentor of the Meek. When these blockers are declared, Hamlet Captain’s ability will trigger and go on the stack. In response, you can cast Shock targeting the Mentor of the Meek. If you do, the Mentor will be dealt lethal damage and go to the graveyard before it would get +1/+1. If you instead targeted the Hamlet Captain with Shock, the Mentor would still get +1/+1.