The dog scratches itself is an equally valid translation.
Why can't it be "a dog is scratching himself"
In Swahili animals must be identified by gender?
No, in fact, people are not identified for gender and animals are treated as grammatically the same as people and not as inanimate things in Swahili. It's simply an issue with not all the possible translations having been added to this course yet.