This seems like a tough task because SVG is quite large. When SVG is loaded as the top document, we use the XML parser which is more general than the html parser and seems even more difficult to guard against (e.g., ENTITY references).
For example, this is an unsafe svg file:
We can base64 encode this as an image, then put that image back into svg and it will be sandboxed:
<svg xmlns="
http://www.w3.org/2000/svg" xmlns:xlink="
http://www.w3.org/1999/xlink" width="100" height="100">
<image width="100%" height="100%" xlink:href="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCI+CiAgPHJlY3QgeD0iMTAlIiB5PSIxMCUiIHdpZHRoPSI4MCUiIGhlaWdodD0iODAlIiBmaWxsPSJncmVlbiIgLz4KICA8c2NyaXB0PmFsZXJ0KCdkYW5nZXIhJyk7PC9zY3JpcHQ+Cjwvc3ZnPg=="></image>
</svg>