Is it possible and safe to uninstall pre-installed apps and to reinstall them when needed? Is it okay to uninstall apps that came with my Mac like iMovie and GarageBand? I don't think I'll be using GarageBand so I'm planning to uninstall it. 

Additionally, if there would be a time I may need it, is it possible to reinstall the app?

Thanks.
iMovie and GarageBand are not necessary to the system and you may delete them at will. However, note that many other apps that come preinstalled on macOS are important to the system (even if it doesn't seem like it) and should not be deleted. As Steve Chambers commented below, though, macOS won't let you delete anything that falls into this category, assuming you aren't doing anything to get around that.
If your Mac was purchased after October 1, 2013, you can re-download the iLife and iWork apps (pictured below) for free at any time from the Mac App Store. Also, regardless of that, if you see them in the Purchased tab of the Mac App Store, that means you do have a “license” for them and can download them at any time.