Of course you can. Like with literally anything we like to do, life gets in the way most of the time. Some people take a break for a few years and come back to pick up their guitar. The guitar basics you learn are similar to riding a bike - you just remember how to do things (most of the time) so you don't necessarily lose all the knowledge you've previously gained. You might forget the chords to a specific song but at least you know how to play those chords in the first place!