Foolish = adjective lacking good sense or judgement; silly or unwise
Stupid = adjective lacking intelligence or common sense.
A person who is intellligent can also be foolish - they can do or say things without judgement. They can also do stupid things.
A stupid person will not be able to judge whether the actions are sensible or not.