In terms of battery cells only, there is no problem.
However, since the shapes of each manufacturer's batteries are different, different brands of batteries may cannot be installed on other brands of machines, but there is no problem if the lead wires are inserted as long as the battery voltage is the same, it can drive the motor of the DC tool.