There is no SVG support by default in WordPress. We can solve this problem with the SVG Support plugin since it is not allowed to upload a file in SVG format to the media library.
The plugin has over 1 million downloads and is regularly updated.
Install the SVG Support plugin on your panel from the plugins area in the WordPress panel.
Plugin Link: https://wordpress.org/plugins/svg-support/
It starts working as soon as the plugin is installed and activated. You can upload files in SVG format to the WordPress media library after you install the SVG Support plugin.