Yes, they can.
Example: During the 2012 UEFA Champions League final, Manuel Neuer of Bayern Munich took a penalty against Chelsea, when the game went into penalties.
When a game is being decided by penalties, then all players must have taken one penalty each, before a player can take a second penalty. So, a goal keeper would have to take a penalty, before any other player gets a second chance.