Scanning already connected BLE devices
This depends on the Bluetooth hardware you're scanning for. Most devices will not be advertising once they are connected, because the whole purpose of advertising is to invite connections from remote devices. Therefore, once a connection is made, there is no need to continue advertising. However, this is not the case for all devices, and some would continue to advertise because they convey extra information in their adverts that may be useful to other scanning devices even if the device is already connected.
For example, the bluetooth earphones that you mentioned only advertise to invite connections from phones/PCs. Once a connection is made, the earphones don't need continue advertising because the purpose of broadcasting its presence has been achieved. There are some exceptions though - e.g. there are earphones that continue advertising even after a connection is made, and the purpose of this is to allow connection from multiple devices.
So to answer your question:-

&quot;So how can we get the list of devices which are in the vicinity and
connected to some other devices?&quot;

Unfortunately in most cases you will not be able to detect these devices because they no longer advertise once they are in a connection.
Finally, regarding this statement:-

&quot;As per my understanding, advertisements are unencrypted but once the
connection is established then all the communication between connected
devices is encrypted.&quot;

It is true that advertisements are generally not encrypted, but once a connection is made it doesn't automatically make the communication encrypted. Encryption is achieved once two devices are paired and one of the devices actively encrypts the connection. In many cases, the connection and communication can remain unencrypted.
For more info, I recommend the following links:-

BLE Advertising Primer
Should One Create a Bond with a BLE device