Being pedantic, I'm not sure whether you want to build a Linux
Distribution or the Linux
Kernel.
Assuming you mean a Linux Distribution:
Yes - you can, providing you have enough computing power - I don't think that a Raspberry Pi on it's own is quite enough to create a build in a reasonable time. As a starting point to see how it can be done, take a look at 'spindle' - the scripts used to create the Foundation Raspbian Wheezy Distribution:
https://github.com/asb/spindle
Or my fork of Spindle that I used to create my own Raspbian Jessie Distribution:
https://github.com/bcroston/spindle
Bear in mind that the .deb packages for armhf v6 have already been built/compiled, saving a massive amount of work.
Of course there are other ways of doing it - I don't know much about how the Arch or the Fedora Remix distributions are created. I'm sure you could even create your own by compiling everything from scratch - this would take you a long time though!
Edit: the PiLFS link above by @fruitoftheloom does this.
-----
Assuming you mean the Linux Kernel:
I've never done this for Raspbian myself. Google is probably your friend here - there are plenty of other people that have done it.