Вот идея без использования flexbox:
.text-justify:after {
content:"";
display:inline-block;
width:100%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
Baseline
<div style="width:500px" class="text-justify">
<h1 class="d-inline-block ">My Title</h1>
<span class="d-inline-block ">Text on the right border</span>
</div>
Middle
<div style="width:500px" class="text-justify">
<h1 class="d-inline-block align-middle">My Title</h1>
<span class="d-inline-block ">Text on the right border</span>
</div>
Использование flexbox Я рекомендую это решение, так как вы рассматриваете bootstrap:
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
Baseline
<div style="width:500px" class="d-flex align-items-baseline">
<h1 >My Title</h1>
<span class="ml-auto">Text on the right border</span>
</div>
Middle
<div style="width:500px" class="d-flex align-items-center">
<h1 >My Title</h1>
<span class="ml-auto">Text on the right border</span>
</div>