1) Can I Doom Blade an attacker after he is declared and prevent damage or do I have to use it as a preemptive strike?
During combat, you can cast instants before attacks are declared, after attacks are declared, before blockers are declared and after blockers are declared. After that, you have to wait until combat damage is calculated to cast another spell or activate another ability.
You receive priority during the beginning of combat step, during the declare attackers step after attackers are declared, during the declare blockers step after blockers are declared, during the combat damage step after combat damage is dealt, and during the end of combat step.
Casting spells before attackers are declared would have to be during the beginning of combat step. After attackers are declared and before blockers are declared is the same time (being the declare attackers step).
First, to answer your questions followed by a detailed description of what actually happens.
1) Yes, after your opponent declares attackers in the Declare Attackers Step, you can cast spells and kill it. You also have the option to cast the spell in the Declare Blockers step to kill it before its damage is assigned; after you have a chance to declare blockers you can cast spells.
2) Yes. After declare blockers, both players have the opportunity to cast spells. You can cast Giant Growth here before damage is assigned and dealt.
The general rule for combat phases is this: First, you do whatever the phase says you are supposed to do, and then all players have to pass priority before the next phase begins, and you repeat this process. Eash phase can be broken down into (Special Action), Active Player gets priority. The beginning and end steps of combat don't have any special actions associated, but the other three do. Here's a list of the combat phases, and what happens: