Depends on the unit. Ships can't upgrade their hulls, engines, and main guns, but AA guns, radar, torpedoes, and ASW equipment can upgrade. Aircraft, tanks, and infantry will eventually upgrade to the newest tech level over a period of time, depending on funding through the top slider on the production screen. You can also put some units back into the production queue to upgrade them to a different class of unit, such as upgrading cavalry to armor, using the wrench icon on the unit's own display window.