They are different.

The one you posted is a simile. Is uses the word "like" to make a comparison "He is like a dog"

Metaphors compare somethings by using the phrase "to be" or a form of the verb "is". "He is a dog"