There is an option in my phone camera to adjust the white balance before taking photo. Again after taking the photo I can adjust it in any photo editing app. Do these two produce the same thing? I also want to know the answer in general for other options like adjusting the contrast, exposure etc.
If you shoot in RAW, the only difference in regard to WB, contrast, and any other settings which are applied after the image was captured is indeed convenience. I.e. on a RAW image, these camera settings are only noted in the metadata and applied (or not,as you wish) by you RAW processor software on your computer. Using different settings will just be the same as if you had set these in the first place.
Your phone camera, on the other hand, is unlikely to produce RAW files, i'm pretty sure it only offers JPEG. In this format, those changes are "baked in", i.e. during the internal conversion from 12 or 14 bit raw sensor data to the 8 bit / colour JPEG a lot of information gets lost, a gamma curve gets applied, and the image is compressed lossy.
Any changes you make after that will degrade your image's quality, as there just isn't any information you can't already see anymore. This degradation may be in the form of banding, or funky colours, etc.
Exposure, on the other hand, is directly affecting the capturing of the image, and can never be adjusted afterwards! You may have some latitude for brightening or darkening an image (more so for RAW data), but overexposed, white pixels won't gain data anymore, and underexposed areas will at least be extremely noisy if brightened in post processing.
Also, exposure consists of exposure time, and aperture. Both of those have an effect on composition: Time affects motion blur, aperture affects depth of field. None of those can really be changed in post!
There is at least one main advantage to setting the white balance beforehand: You will have a better assessment of your exposure by looking at the preview. Theoretically white balance adjustment must also have an effect on camera's exposure measurement, but that is not the case for all the cameras.
A second, and more important, advantage of setting the white balance at the time of shooting is that you can actually get the white balance readings on the spot, while if you adjust afterwards, you will be somehow relying on guesswork.
This becomes advantageous mainly when you have a neutral grey card and your camera can do manual white balance adjustment. Like that you can find the right white balance at the time of shooting and keep shooting with the same white balance values as long as you are in the same lighting condition. No guesswork during the post can can accurately emulate that process.
But again, this point becomes important if your camera has support for manual white balance.