No. SMS over IMS is not the only way for the SMS to be transmitted in 4G/5G.
In both 4G and 5G (SA) architectures you can send an SMS in two ways: over IP/IMS, or over NAS (SG-SMS).
So for the equipment to send an SMS over IMS you need to first register on IMS (either VoLTE or VoWifi) including +g.3gpp.smsip
parameter into the Contact header of your IMS SIP REGISTER.
If you do not inform SMS over IMS capability to the network in that registration, you'll send/receive SMS over NAS. It's very similar to an SMS sent over 2G/3G network, in the sense that the data/text is sent into a control channel and not a data channel.
The ideal way is to send SMS over IP/IMS (IMS is meant to transfer any type of data: text/audio/video/etc.), but there's the fallback solution in both 5GS and 4G networks which is SMS over NAS signaling. Because IMS capability varies a lot from operator to operator, the SMS over NAS is a very common scenario.
For more details, refer to the specifications: 3GPP TS 24.341 (Support of SMS over IP networks) and 3GPP TS 24.301 (Non-Access-Stratum protocol for EPS).