It will check for a creature of power 4 or greater when it resolves. Wild Slash says damage can't be prevented, but in any case the Ferocious text would happen.
Abilities that trigger when you cast a spell, such as Kiln Fiend's, trigger as soon as you finish the process of casting that spell, and the first step of casting a spell is to put it onto the stack. So the resulting triggered ability will go onto the stack on top of the spell and resolve before the spell does.
If a spell checks the game state to determine part of its effect, it does so during the spell's resolution at the time that the information is needed, unless the information comes from something that was done during the process of casting the spell (like the power of a creature sacrificed to Fling) or the card says otherwise. Wild Slash cares about whether you control a creature with 4+ power at the point that it resolves.
Put together, the result is that you do get the Ferocious effect in this scenario.
Wild Slash deals 2 damage regardless of whether you control a creature with power 4 or greater. (The condition "If you control a creature with power 4 or greater" applies only to the first paragraph and not the second; this ought to be clear because of the paragraph break on that spell [C.R. 112.2c].)
Wild Slash will check whether you control a creature with power 4 or greater when it resolves (C.R. 608.2g). Therefore, in your scenario, Kiln Fiend, now 4/2, will count as a creature with power 4 or greater by the time Wild Slash resolves, so that if you control Kiln Fiend as that spell resolves, damage can't be prevented this turn.
The check is on resolution because the ferocious ability is just another clause in the spell's effect. Therefore, casting the Slash in this scenario means damage can't be prevented the turn you cast it.
Not sure where you got 4 damage from. It's sadly not a Galvanic Blast variant, as much sense as that would make.
Kiln Fiend vs Wild Slash
When cast Wild Slash will trigger Kiln Fiends ability and giving it +3/+0
But does Wild Slash check for a creature of power 4 or more when cast? when it resolves?
In other words would Wild Slash do 2 damage or 4 in this case?
--
It will check for a creature of power 4 or greater when it resolves. Wild Slash says damage can't be prevented, but in any case the Ferocious text would happen.
If a spell checks the game state to determine part of its effect, it does so during the spell's resolution at the time that the information is needed, unless the information comes from something that was done during the process of casting the spell (like the power of a creature sacrificed to Fling) or the card says otherwise. Wild Slash cares about whether you control a creature with 4+ power at the point that it resolves.
Put together, the result is that you do get the Ferocious effect in this scenario.
Wild Slash will check whether you control a creature with power 4 or greater when it resolves (C.R. 608.2g). Therefore, in your scenario, Kiln Fiend, now 4/2, will count as a creature with power 4 or greater by the time Wild Slash resolves, so that if you control Kiln Fiend as that spell resolves, damage can't be prevented this turn.
Not sure where you got 4 damage from. It's sadly not a Galvanic Blast variant, as much sense as that would make.
I̟̥͍̠ͅn̩͉̣͍̬͚ͅ ̬̬͖t̯̹̞̺͖͓̯̤h̘͍̬e͙̯͈̖̼̮ ̭̬f̺̲̲̪i͙͉̟̩̰r̪̝͚͈̝̥͍̝̲s̼̻͇̘̳͔ͅt̲̺̳̗̜̪̙ ̳̺̥̻͚̗ͅm̜̜̟̰͈͓͎͇o̝̖̮̝͇m̯̻̞̼̫̗͓̤e̩̯̬̮̩n͎̱̪̲̹͖t͇̖s̰̮ͅ,̤̲͙̻̭̻̯̹̰ ̖t̫̙̺̯͖͚̯ͅh͙̯̦̳̗̰̟e͖̪͉̼̯ ̪͕g̞̣͔a̗̦t̬̬͓͙̫̖̭̻e̩̻̯ ̜̖̦̖̤̭͙̬t̞̹̥̪͎͉ͅo͕͚͍͇̲͇͓̺ ̭̬͙͈̣̻t͈͍͙͓̫̖͙̩h̪̬̖̙e̗͈ ̗̬̟̞̺̤͉̯ͅa̦̯͚̙̜̮f͉͙̲̣̞̼t̪̤̞̣͚e̲͉̳̥r͇̪̙͚͓l̥̞̞͎̹̯̹ͅi͓̬f̮̥̬̞͈ͅe͎ ̟̩̤̳̠̯̩̯o̮̘̲p̟͚̣̞͉͓e͍̩̣n͔̼͕͚̜e̬̱d̼̘͎̖̹͍̮̠,͖̺̭̱̮ ̣̲͖̬̪̭̥a̪͚n̟̲̝̤̤̞̗d̘̱̗͇̮͕̳͕͔ ͖̞͉͎t̹̙͎h̰̱͉̗e̪̞̱̝̹̩ͅ ̠̱̩̭̦p̯̙e͓o̳͚̰̯̺̱̰͔̘p̬͎̱̣̼̩͇l̗̟̖͚̠e̱͉͔̱̦̬̟̙ ̖͚̪͔̼̦w̺̖̤̱e͖̗̻̦͓̖̘̜r̭̥e͔̹̫̱͕̦̰͕ ̗͔̠p̠̗͍͍̱̳̠r̰͔͎̰o͉̥͓̰͚̥s̟͚̹̱͔̣t͉̙̳̖͖̪̮r̥̘̥͙̹a͉̟̫̟̳̠̟̭t͈̜̰͈͎e̞̣̭̲̬ ͚̗̯̟͙i͍͖̰̘̦͖͉ṇ̮̻̯̦̲̩͍ ̦̮͚̫̤t͉͖̫͕ͅͅh͙̮̻̘̣̮̼e͕̺ ͙l͕̠͎̰̥i̲͓͉̲g̫̳̟͈͇̖h̠̦̖t͓̯͎̗ ̳̪̘̟̙̩̦o̫̲f̙͔̰̙̠ ̹̪̗͇̯t͖̼̼͉͖̬h̹͇̩e͚̖̺̤͉̹͕̪ ͚͓̭̝̺G͎̗̯̩o̫̯̮̟̮̳̘d̜̲͙̠-̩̳̯̲̗̜P̹̘̥͉̝h͍͈̗̖̝ͅa͍̗̮̼̗r̜̖͇̙̺a̭̺͔̞̳͈o̪̣͓̯̬͙̯̰̗h̖̦͈̥̯͔.͇̣̙̝