Example scenarios:1) Der Junge dachte sich, dass wenn er wieder laufen konnte, würde er Fussball spielen. 2) Der Junge dachte sich, dass wenn er wieder laufen könnte, würde er Fussball spielen.
The only immediate difference between these two sentences is the difference in the verbal mood of the verb "können". In sentence 1, the verb is in the indicative mood - we might say this is the 'standard' mood. Looking at sentence 1, we could imagine that the boy has broken his leg and the doctor has promised him that it will heal completely - and so he decides that once it is healed (as he is sure it will) he will play football. In this case, "wenn" translates as "when".
In sentence 2, the verb is in the subjunctive mood - in German "Konjunktiv 2". The subjunctive expresses uncertainty or hypotheticality. In this case, we could imagine the following scenario: The boy has broken his leg but he is not yet sure if it will heal properly - so he doesn't know if he will be able to play football. Because of the change in verbal mood, "wenn" now comes to mean "if" as this mood expresses uncertainty.