Well I'm trying to write a song and the chord progression is D, Bm, G, A. What I'm not sure about is that I'm trying to do a walk down from B to G with A and G#, but G# isn't in the D scale, so I'm not sure if that's wrong or not. Basically, I'm asking if all the chords need to be in the D scale and it's wrong to have a G# chord in the mix. EDIT: I have B, D, Gb, B, back to Gb, D going in the right hand and I want two triads in the left going during Gb and D in the right before hitting the G chord.
It is a very good idea to play with notes that don't belong to the current key, especially if you are moving towards the base note of the next chord. By playing the G#, you'll create a kind of tension which is resolved by finally moving to the G. Such cadences are very common in Anglo-Saxon music -- in fact our music revolves heavily around such tension-and-release patterns.
By the way, you might want to forget that things can be "wrong". Of course, there are things that obviously sound bad, but if something sounds good to you, there's nobody who'll tell you that you shouldn't play it. As many people say: once you know all rules in music, it's time to start breaking them. :-)
Often, there are not rights and wrongs in music. Technically, lots of things can be explained, but the basic premise has to be - if it sounds good, then it's o.k. A G# chord is not in the key, true, but it fits what is called a tritone substitution, nearly. Make it a G#7 and it's there. Music often uses a one semitone move to resolve itself. So, it's alright. And it sounds good, too.
That Gb in your song will be an F#, as D contains #s already, and another 'black note/key' should try to match. It's easier for readers, too.
At the end of the day you should do what resonates with you. A lot of the time, some of the coolest and most interesting sounds/chords come from stepping outside normal scales. I recommend you explore new possibilities, because you might find something awesome which you might wanna use in the future; don't limit yourself. If you really have to, you can also change it back in the future if you think it sounds strange.