-i is definitely not specificed by POSIX, but it supported on all those platforms with some small differences, for instance on OSX the backup extension (-i.bak) is not optional.
(Would love to be proved wrong on this)
sed -i.bak 's/foo/bar/' filename
[1]: https://stackoverflow.com/a/22084103/3266847 sed -i ‘’ ...
works on BSD sed but not GNU. Meanwhile: sed -i’’ ...
sed -i ...
both work on GNU but not BSD.