Can I use the insect creatures created by hornet Nest to block the same attack that did the damage that created the creatures?
No, if attackers already dealt combat damage it would be too late.
If a spell or ability dealt damage to Hornet Nest after attackers were declared but before blockers are declared, the tokens will be created in time for them to block. On the other hand, if Hornet Nest was dealt combat damage this way (during the combat damage step), it would be too late because the time to declare blockers has already passed.
Do the go on the stack?
If Hornet Nest is dealt damage, its triggered ability will trigger and go on the stack (C.R. 603.3).
If a spell or ability dealt damage to Hornet Nest after attackers were declared but before blockers are declared, the tokens will be created in time for them to block. On the other hand, if Hornet Nest was dealt combat damage this way (during the combat damage step), it would be too late because the time to declare blockers has already passed.
If Hornet Nest is dealt damage, its triggered ability will trigger and go on the stack (C.R. 603.3).