Most products used in auto-electrical systems can be considered "two terminal" devices, meaning there are only two connections (power and ground). This includes:
For these "two terminal" devices, it does not matter to the internals of the device which order of connection is used. Other factor, Eg safety, convention or habit will determine order of connection.
Many other products in vehicles, however, should be considered "three terminal" devices. They have (at least one) input, (at least one) output and a common ground terminal.
Examples of three terminal products include:
The ground terminal provides, Eg, a reference point and a path for drive current for internal components.
All "three terminal" devices, not just common ground voltage converters, should have ground connected first and disconnected last. They should never be switched on and off via a switch in the earth line unless explicitly recommended by the manufacturer.
Some voltage converters, if they have input and output connected before ground is connected, will start to operate without this reference. This means there is no internal reference to zero volts and no sink for drive current. This may cause erratic modes of operation, such as:
There are many other scenarios involving other types of "three terminal" products where similar or worse problems can arise if ground is connected last or disconnected first.
The same thing applies with switching on/off. An on-off switch must never be placed in the earth line of a "three terminal" system (unless it is specifically recommended by the manufacturer).
Some manufacturers design products to avoid, as much as possible, problems associated with "loss of earth" but never assume it is a safe practice to have power on any three terminal product without earth.