Edit: I didn't read properly... You're doing this for other people. Maybe you should go with the conservative option, then.
(I mean if their devices already support it, there's no harm in forgoing compatibility and just go with a more modern encoding format like HEVC or better AV1. It's not like the next laptop or TV will be unable to play it... But H264 is certainly a safe bet. That's supported everywhere.)
Also second the point about the container. It doesn't really matter, just go with mkv. In the unlikely case it doesn't work, you can always take the video an put it in a different container. That kind of conversion is fast and without loss.