”Jeg kender ham” is correct. “Ved” is used about information. The word “ham” is not information; “ham” is a person.
“Ved” as a verb is usually followed by “noget”, “det” or a hv-words. Here’s some examples.
“Jeg ved ikke noget om det.” = ”I don’t know anything about it.”
”Morten ved, hvorfor jeg gjorde det.” = ”Morten knows why I did it.”
“Min mor ved, hvor det ligger.” = ”My mother knows where it is.”
“Jeg ved det godt.”
Here’s an example where we use both kinds of ved.
”Der er en, der ved det. Jeg kender den, der ved det.” = ”There is (some)one who knows it. I know the one who knows it.”
I hope this helped.
“Ved” can also mean “at”.
Example: “Jeg er ved bilen” = ”I am at the car”
In your example with the mouse and the elephant: Ved is just a part of the Danish expression for the word “touch”. The dictionary says that “to touch” is called “at røre” in Danish, but we often add a “ved” after it, so
“at røre ved” = “to touch”. I don’t know why we do this.
Bonus knowledge: If you add “i” instead of “ved” after “at røre”, it means “to stir”. In shorts “At røre i” = “to stir”.
If you add “sig” instead, you get “at røre sig” which means “to move”.