Is it penile cancer if the foreskin is red and swollen and smells bad?

It is likely to be penile cancer and it is advisable to go to the hospital for timely consultation.