Basically, they were both fans of Shaun of the Dead and knew the director. From an interview on About.com with Edgar Wright:
Interviewer: How did you get Cate Blanchett to do that one little cameo?
Wright: I'd met her in LA and knew that she was a fan of Shaun of the Dead, so that was kind of a start. The first thing we wrote in Hot Fuzz is the kind of the girlfriend scene with the CSI sort of [setup]. The first joke was basically that you have an emotive scene with him saying farewell to his girlfriend and being very sentimental and you can't see her face. [...] In a weird way this whole Cate Blanchett thing was sort of a slight kind of joke on that. ‘Let's get an Oscar winner in there but not see her face.’ And she was totally up for that joke. She loved it. And for the record - and this is why Cate Blanchett goes to heaven - she gave her fee to charity. She is one nice lady.”
Interviewer: You also had a second person in there that might not be recognized by audiences.
Wright: Oh, yeah, Peter Jackson is in there as well. The irony of Peter Jackson is that we got him to play Santa Claus and the irony is that we had to give him a fake beard and pad him up. The two things that three years ago would be the prerequisite for the role, like he'd both lost.
He was in the UK and he was a big supporter for Shaun of the Dead since it came out. I'd become friends with him, which was great. I actually went over on a little holiday when they were shooting Kong, which was great, and hung around on the set like a work experience kid. I was telling him about Hot Fuzz and he said, ‘I'll be in the UK and I'll do a cameo if you want.’ Then I thought, ‘F#@k, he should play Santa.’ It was brilliant, actually. It was really cool because it was so sweet. He was in London for a week and we actually shooting outside and he came all the way down. His cameo is like five seconds long. He was really cool.