How do you choose who writes each (major) character in a game, also who's allowed to do any writing?
Depends, sometimes it's just necessity (you have the most bandwidth, so you do X person, or you're already doing the main city where the character resides, so it's best if you write Y antagonist), other times we're able to purposely assign folks with skill sets to characters (which Josh did on Fallout New Vegas). For Fallout New Vegas, Josh broke down the companion personalities and assigned them to designer he felt showed strengths in those character backgrounds - for example, understanding of certain psychological conditions, or (in my case) because I'd written the father of one of the companions, or because the person has a fluid storytelling style (Travis Stout, which is only one of his strengths), which makes him great for characters with campfire stories to share.
What if a programmer/artists/whatever suddenly really wanted to do some writing, would he/she have a chance, even if minor?
If there was room in the schedule, sure. We'd probably ask they do a minor character first to get a feel for their writing, since it's more than just writing - it's the scripting and editor knowledge as well. In my experience, however, it is very difficult to break out of a role, and even designers that are jack of all trades usually take on one specific role per project because that's all there's time for. That's true across all departments. I have found developers that knock their own writing are actually much better than they realize, however, and all they need is to be told that to make them more confident about stepping up.