I’m going to start by reframing your question slightly to: how does SonarQube identify “new code”? The answer to that is that by default it uses your SCM “blame” data to identify which lines of a file have been added/edited in the target period (since your New Code Period started).
Now to return to your original topic, “changes between given two bitBucket builds…” the answer is that SonarQube really doesn’t operate on a build-to-build basis. With branch/PR analysis (which is a commercial feature) SCM data is again used to understand which lines are new since the branch point, which may or may not be the previous analysis of the target branch.
What about “between two bitbucket branches”? Sorry, but that’s really out of scope. If you really just want to identify which lines of code are different from branch to branch, you’re probably best off working in your SCM context.