Aside from their side and default location/alignment, you can't change how the Add Object
tools will make the objects, including their origins. What you can do, is add a cube, set their origin where you need it to be, and then duplicate that cube.
Edit origin
There are several ways to change an objects origin, but for your specific need, the simplest might be to go in Edit Mode, select the vertex where you want the origin to be. Then press ⇧ ShiftS → 3D cursor to selected
.
Switch back to object mode, press ⇧ ShiftS → Origin to 3D cursor
.
Another way is, first enable the option Affect Only Origins
in the top right Options
popover:

Then set your snapping to vertex:

Then select your cube, press G to move your cube's origin, hold down ⎈ Ctrl to enable the snapping, move your cursor to the vertex you want to move your origin to, and validate by
LMB or ⏎ Enter.
Don't forget to disable Affect Only Origins
after you're done.
Ctrl+A
in object mode then Apply Transformation. $\endgroup$