When two commits in two separate repositories have the same object ID, they will refer to the same history, including all commits, trees, and blobs reachable from them, assuming no hash collisions have occurred.
Note that this does not mean that the repositories are completely identical. Those two repositories might have branches, tags, or other references pointing to different commits, and they may also have different sets of objects referred to by the reflog.
Note that if you are using a SHA-1 repository, it is not safe to rely on the absence of hash collisions. The cost to create a SHA-1 collision is approximately USD 11000, so any medium-sized company or government agency can afford to create collisions. While Git has measures to detect if colliding objects are pushed to a repository, that wouldn't have any effect if the repositories were separate. If you require integrity, you need to use a SHA-256 repository instead.