How to put inside a svg

Is there a way to put a div inside a path?

It works fine with rect

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <rect class="bg" id="bg" x="0" y="0" width="200" height="200" fill="#0357D5"></rect>
    <foreignObject x="0" y="0" width="60" height="50">
        <div xmlns="http://www.w3.org/1999/xhtml">Thanks </div>
    </foreignObject>
</svg>

but not with path

<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <path class="pth" id="pth" d="M0,0, L200,0, L200,2000, L0,200 ,Z" fill="red"
            style="stroke-width: 0.5; stroke: red;">
    <foreignObject x="10" y="50" width="60" height="50">
        <div xmlns="http://www.w3.org/1999/xhtml">Thanks </div>
    </foreignObject>
</svg>

Is there a way to achieve this?