If Facebook, YouTube and others video hosting sites re-encode all videos uploaded, is the codecs used still matter?
Both no and yes.
Technically, no, because they can handle most common formats and re-encode what you give it no matter the format.
Practically, yes, because you have to take into account your time, energy usage, and upload speed.
If I use h.264 codec with mp4 or MOV format as Facebook recommended, will it reduce or bypass the Facebook's video processing?
No. They almost certainly re-encode everything for consistency.
If I use h.265 for smaller file size, will the viewers of my video save their mobile data usage?
If the quality between the two formats is the same, then the answer is no.
What to do
Because it appears you are re-encoding something that has already been losslessly compressed I recommend that you upload the original file and avoid the needless re-encoding step. You'll save time and avoid generation loss.
If you have to re-encode
If you must re-encode, such as if the original was encoded inefficiently, or is too big to upload, or you want to modify the video (such as by using filters), then provide "visually lossless" or as close to that as you can while still being practical to encode and upload. Avoid lossless as it will make a huge file.