How do the up grades work specifically?

Are all upgrades purchased logical for all types of units?