The sentence does not make sense because the adverbial phrase "to compare ..." seems to be modifying the verb "know". However,
"My friends don't know to compare me to him",
does not mean what you want it to mean. The issue is not whether or not your friends know to compare you to your dad. The issue is whether they know him well enough.