Animals definitely know. The one day that I've been sick since Ruby arrived, she curled up with me on the couch for most of the day…wasn't her usual rambunctious self.
I once was taking care of my friend's black lab for a weekend and was sick one of the days. I was on the couch and the dog just came over and put his head on me like he was saying "sorry you don't feel well...don't worry about running around with me, I'll stay with you"...it was the sweetest thing, and we basically just hung out in front of the fire for the day.