This site says that it has to do with food.
Foxes are drawn into houses by the availability of food. They will take advantage of open windows, doors, and pet flaps to come inside and wreak havoc. The pests makes messes of kitchens as they forage for fish, meats, fruits, vegetables, and even garbage.
Source
This fox in London was apparently a gamer,
A cheeky fox has been caught on camera as he casually sneaked into a family home - before stealing a nine-year-old's PlayStation controller.
Source
This one attacked two nine-month-old twins,
Shortly before 10pm, a curious fox padded into their home in Victoria Park, east London, and made its way upstairs, where their nine-month-old twins Lola and Isabella were asleep. The fox attacked the girls on their arms and faces. When Pauline heard the crying, she rushed upstairs. "I went into the room and I saw some blood on Isabella's cot," she said yesterday. "I thought she'd had a nosebleed. I put on the light and I saw a fox and it wasn't even scared of me, it just looked me straight in the eye."
Source
This one attacked a four month year old,
But the BBC's John Andrew said: "The mother was at home and heard this awful scream, went next door where the baby was, found it had been dragged from the cot onto the floor and the baby's hand was in the jaws of the fox.
"She was obviously in a terrible panic and did what she could to get the fox off, including kicking it. Eventually it did let go but the baby was found with quite serious injuries."
Our correspondent said it was believed one of the baby's fingers was severed but later re-attached by surgeons in a "delicate and difficult" three-hour operation, although it has not been confirmed by the hospital.
Source
It seems like they will go inside a person's house to get food, or to get out of the cold or just out of curiosity. They do pose a danger to very small humans, but that type of behavior is rare.