o chapéu custa menos de que o casaco, Why is "de" wrong here?
In comparison, we use "que" or "do que"
and this both means the same thing? Or are there different contexts in which you would use 'que' and 'do que' ?
They mean the same ;)
Why is it used then
It is optional, so both versions should be accepted.
Can I say "do casaco" without "que"?
Paulenrique explained up above that you must say either "O chapéu custa menos que o casaco" or "O chapéu custa menos do que o casaco".