Can you use a Thunderbolt 3 cable to connect two Macbook 12-inch in target disk mode?
There's two kinds of Thunderbolt cables, active and passive. There's two kinds of USB-C to USB-C cables generally, active and passive.
Passive Thunderbolt 3 cables will be no longer than about 0.7 meters. These are relatively inexpensive and because they are passive they will always work as USB cables. Active Thunderbolt 3 cables will be longer (because the only reason to make them active is to overcome the length limit), they will be more expensive than other USB-C to USB-C cables (because there are expensive electronics in the cable), and may or may not work with USB hosts and devices (because the Thunderbolt spec only requires Thunderbolt hosts to support USB, it's optional for cables and devices).
The USB-C spec requires that the supported protocol be indicated on the cable ends with some kind of icon and/or text. It's unfortunately common for USB-C to USB-C cables to have no markings, which does not mean they will not work as Thunderbolt or USB 3.x cables but means they were not tested to meet the spec.
One "rule of thumb" on USB-C cables is to simply assume they are passive unless there are some markings to indicate otherwise. A passive USB-C cable under 0.7 meters is likely to support 40 Gbps USB4 and Thunderbolt. If it has the Thunderbolt icon on the cable connectors then it's been tested to support 40 Gbps USB4 and Thunderbolt, and because the cable is passive it will work with any other protocol up to 40 Gbps.
A passive USB-C cable that is a meter or less in length will likely support 5 Gbps USB 3.0, 10 Gbps USB 3.1, and 20 Gbps USB 3.2. The cables all had to meet the same spec to comply with USB 3.0, 3.1, and 3.2, the increase in speed is from increasing efficiency in how they used the wiring in the same cables. Again if there are USB markings then the cable has been tested to meet the spec, the stylized "SS" icon will indicate support for 5 Gbps and there will be a small 10 or 20 on the connector if tested for the higher data rates. Also by being passive they will work as DisplayPort cables or any other protocol used by USB-C and does not exceed the data rate supported by the cable.
Passive USB-C cables over a meter in length will only support USB 2.0 speeds, the "super speed" data wires will not be present in these cables. Again it's far too common for USB-C cables to lack proper markings so expect inexpensive USB 2.0 cables to lack markings and expensive active cables (with the "super speed" data wires) to have the correct markings. If someone is going to sell an $80 active Thunderbolt cable then they are not likely to go cheap and not put the little Thunderbolt icon on the connectors.
There is no rule of thumb on active USB-C to USB-C cables, the data rates and protocols they support is all on the electronics in the cables. Some active Thunderbolt cables will advertise backward compatibility with USB 3.x, others will explicitly state they don't have backward compatibility, and some will leave you guessing.
Let me see if I can summarize all this in one short paragraph. All passive Thunderbolt 3 cables will support USB 3.x. All Thunderbolt hosts will support USB 3.x devices. Some Thunderbolt devices and some active Thunderbolt cables will support USB 3.x. All cables that meet the USB-C spec will mark the connectors for the protocol and data rate they support. A lack of markings means they might work with Thunderbolt or USB 3.x, or they might not, most likely these will be USB 2.0 cables and only really useful for low data rates and battery charging.
I hope that helps.