How can I create an object that fits in the gap of another object?
This type of cutting actually doesn't require doing a boolean. You can use Knife Project instead.

First, using your T-shaped piece as a starting point, model a flat piece that is the same shape when viewed from the side. You can snap to verts while constraining the axes to do this.



Then, separate this into its own object. This object will cut into your circular one, so first select the cutter object and then Shift-select the circular one that will be cut (order of selection matters).



Tab into Edit Mode and Hide the parts of the mesh you won't be cutting (the T-shaped piece). 



Select All, view from the side, and click Knife Project. Enable the Cut Through option in the Operator Panel.







You will end up with a nice clean cut in your mesh.



You can then delete these faces and fill them in however you like.