Yes, it's possible. It's recommended to take an entire day trip to Granada to fully explore the Alhambra and its surroundings. Read more here.