Most elephants including wild elephants are pretty good with humans but since the wild elephant has not been around humans much you need to be cautious around the wild elephant.
An elephant could easily crush you and kill you if it saw you as a threat so it would actually be best to keep your distance from wild elephants.
If you really want to pet an elephant or get really close to an elephant go to a zoo or circus and visit the elephants there.
You can usually pet an elephant at a zoo or circus and those elephants are used to humans so they are less likely to attack humans and may want to be pet and have the love and affection from a human.
You could pet a wild elephant but be very cautious and approach the elephant slowly to see if they want you near them.
If they seem like they don't like you coming towards them then stop walking towards them and back away and leave them alone and enjoy the elephants at a distance.