Yes - but if they change to an alignment disallowed by that god - they lose their powers, and they have to either atone or find a different god to worship.
Plus, in some settings, you don't get to "make up a god" or "make up an ideal to follow" - you have to use one of the existing ones.
Finding a different god to worship may involve getting an atonement spell, or a quest from another cleric of that god, to prove eagerness to worship the new one and convince them that they won't defect again.