Hi Adeel5FD6,
something similar will happen with an InDesign document in a shared Dropbox folder.
There is no way within InDesign to disable that behavior.
You need other means to watch documents that are about to be used by more than one user.
Workflow management software could do this.
There is also an idea using a script for InDesign to notify a user if a particular document is already opened by a different user. This requires one entry in the GUI of InDesign. Under File > User… there must be a unique entry for a particular user plus a startup script that is writing information about a document to a log file using the "beforeOpen" and after looking up the log also the "afterOpen" event listener in InDesign.
More on that at Kasyan's website:
http://kasyan.ho.ua/indesign/event_scripts/warn_about_docs_open_on_dropbox/warn_about_docs_open_on_dropbox.html
Also see what Max Schmidt did on the basis idea by Kasyan Servetsky:
https://community.adobe.com/t5/indesign-discussions/idlk-files-over-cloud-storage/m-p/11598431#M403807
Regards,
Uwe Laubender
( Adobe Community Professional )