I'm running some service on the Ubuntu 18.04 in which the machine has 16GB memory.
Because of a certain reason, I want to install an additional 16GB of memory.
So, is it safe to install an additional memory card while running my service?
If not, do I have to stop my service, shutdown the Ubuntu machine, install an additional memory card on the machine, restart the machine and restart my service?
No, you should close the service, and shut down the server, then unplug the power.
Not only does it require shutdown, but a memory test run is highly recommended. Hold [shift] on startup, then in the menu, choose "Test memory".
Please also consult your motherboard manual for the optimum slot to use to put that memory module into, and use anti-static precautions when handling the memory and installing it.