Q:

Can I override Gradle module's dependency with version built within the same multi-module project? 

Imagine there is a Gradle project with 2 modules, modA and modB.  modB depends on modA.
// within modB's build.gradle
dependencies {
    implementation 'com.example:modA:x.y.z'
}

I could also define the top level's project dependencies like this:
// within the top level build.gradle
project(':modB') {
    dependencies {
        implementation project(':modA')
    }
}

In this latter example, the output from modA's compilation is put on the classpath for the compilation of modB.
What happens if I use both in the same project: what version of classes will get compiled into modB?   Will it be version x.y.z of modA, or will it be the versions that have just been compiled? 
I'm trying to work out a sensible way of versioning a monorepo's submodules, where each submodule needs to have a separate version and I'm wanting to understand how Gradle resolves versions. 

A:

These notations are different:

First asks gradle to go to the repository (public or local, it depends on main gradle file) and get jar from there.  In this case mobB and mobA are fully independent, so they could be built in parallel. 
Second asks gradle to use local project.  It means that mobB requires compilation of mobA, etc. 

For complex multiproject, please also consider Spring Dependency Management plugin.  It allows you to define complex rules at the one include script.  For example, you can put logice like this "if project is external client then exclude the following".  As a result, you can consolidate all dependencies and versions at the one script, so your project will contain nothing.