how can you draw inside a shape in preview app? [duplicate]

Remove the fill of the object (i.e. select the diagonal line to the left of the black and white colour line - see image below) but leaving an outline, draw inside, or on top of it, then add the fill again.

Fill enter image description here

If it's a complex fill, save it first, by clicking "Show Colours..." and adding it there.

Note: this will not group the two layers drawn and they will have to be moved individually, or by selecting them both (with the shift key). If grouping is expected, I refer to @benwiggy's comment to use a dedicated drawing application.

PS. If flattening the image is of no consequence, consider theonlygusti's comment, or the linked to previous answer to this question.