You can, but there are extremely few options, afaik the only real one being Microsoft’s SwiftKey, or GBoard. Both are way worse than their android counterparts however
I haven't owned an Apple device in over a decade, but I believe Apple finally decided loosen the shackles a little bit and started allowing it maybe two years ago?