Libraries that you are including as AARs (or remote dependencies from maven repositories) are already compiled, so their
compileSdkVersion and build tools has no bearing on the compatibility with your app.
Of course, if they are compiling with say, API 23, they cannot set their
targetSdkVersion greater than API 23 (since
targetSdkVersion <=compileSdkVersion and that might affect how the library works at runtime (maybe the library is aware of API 26’s Background Execution Limits, for instance).