Every car is different but for most cars you can change the oil pump with the engine in the car. However this may require removal of some additional parts besides the oil pan and pump. For example you may have the remove part of the exhaust system in order to remove the oil pan. A repair manual for your particular car can be helpful in guiding you with the repair and give you information on what may need to be removed to make the repair.
Hope this answered your question Backyardmechanic