Yes. If two short-haired German Shepherds carry the gene for long hair, they can have a long-haired puppy.  It’s even been known for a litter to contain German Shepherd puppies with both long and short coats, as the gene is present in both parents but not passed down to all of their offspring.