No you absolutely cannot use any socket that has give in it like the type you pictured. The variation from actual torque could vary wildly depending on the minute design details, metal type, tolerances, specific torque value, temperature, humidity/rust, lubrication of the moving parts, etc, etc.
It should be the size of the bolt head, as short as possible and no extension on it if you want as close as possible. Granted as close as possible is not always all that important but those universal fit sockets are about as far from predictable as it gets.