I've just had some of my answer poached by a user here. This is what the source
of the post now reads:
Unfortunately you are not allowed to mix-and-match with units from different Codices any which way. The different books are tuned somewhat to have different strengths and weaknesses. What's acceptable in 'normal' play is of course up to the people you play with! If it's something fun and flavourful, most people will probably allow it. If you pick and choose the best unit in each slot from each Codex, don't expect anyone will allow it.
However, as of the publication of the 6th edition rulebook in July 2012 an army may have an 'Ally Detachment' containing a limited number of selections from another codex. An army based on one the Space Marine Codex can include these others as allies:
**Battle Brothers:**
- [Black Templars][2]
- [Blood Angels][2]
- [Dark Angels][3]
- [Space Wolves][4]
**Allies of Convenience**
- [Grey Knights][5]
[1]: http://wh40k.lexicanum.com/wiki/Black_Templars
[2]: http://wh40k.lexicanum.com/wiki/Blood_angels
[3]: http://wh40k.lexicanum.com/wiki/Dark_Angels
[4]: http://wh40k.lexicanum.com/wiki/Space_Wolves
[5]: http://wh40k.lexicanum.com/wiki/Grey_Knight
Of course you can paint your models any way you like and have a mix of units from different 'Chapters' as long as the actual rules in use form a legal army.
Editing in content from comments:
There has in the past been a ruling in the Grand Tournament FAQs that if you use an 'official' paint scheme, the army must use the corresponding Codex or the 'vanilla' Codex: Space Marines. e.g., no Red Marines with blood drops on their shoulders "counting-as" Black Templars. But red marines with blood drops counting as plain old vanilla codex marines are ok.
Edit: adding content provided by purefeet so that the answer accepted by OP is up to date
You can see where part of my answer has been copy-pasted wholesale, the citations floating part way down the answer.
Had I wanted to merely update the accepted answer I could have done so. This whole thing has left a bad taste in my mouth.
Is this acceptable behaviour?