Yes, in System Preferences, go to International >> Input Menu and select the keyboard layout you want - usually the one that's named after your country.
I am using Slovenian and English key input.
For Messenger and Word i use Slovenian. But for programing i am using English key input because of signs that are easier to write.
So i want to edit English key input and change the "y" to "z" if it is possible.
Then you have to modify the keyboard layout. I recommend Ukelele. Just have a look around their site (You probably have to restart before you can use the newly created layout.)