How to check SMB connections and the dialect that is being used on linux?

If you are running a Samba server on Linux, smbstatus should show the protocol version used by each client.

If Linux is the client, it depends on which client you're using: if you're using the kernel-level cifs filesystem support, in all but quite new kernels, the answer was that you look into /proc/mounts to see if the mount options for that filesystem include a vers= option; if not, assume it uses SMB 1.

SMB protocol autonegotiation in kernel-level CIFS/SMB support is rather recent development, and as far as I know, if you don't specify the protocol version you want, the autonegotiation will only indicate the result if you enable CIFS debug messages. but fortunately the developers made it so the negotiation result will always be shown in /proc/mounts.

If you use smbclient or other userspace SMB/CIFS clients (e.g. one integrated to your desktop environment), then it might have its own tools and diagnostics.