Yes it's fine to prune trees, in fact it's usually recommended to help keep the tree healthy. Any dead wood can be pruned off at anytime. Any limbs that are crossing each other should also be pruned off, the earlier the better. You can also lightly prune it to help keep it nice looking. Do not cut off more than 1/3 of the foliage at any one time. As for when, do it after you have harvested your lemons but before it has flowered again, though if it's like my Meyer Lemon tree, it may have ripe lemons and blossoms at the same time. I also prune off thorns when they grow. I've bled a few times too many.
http://www.botanical-journeys-plant...trees.html You probably also want to root prune and replace the soil in the pot. Citrus trees are heavy feeders and many fertilizers are heavy with salts. Unpot the tree and soak off the soil in a bucket of water. Clean the pot, put a coffee filter on the bottom and fill part way with new potting soil. Trim off no more than 1/3 of the roots and comb them out a little. Repot in the same pot and fill around the roots with new potting soil and water thoroughly. Be careful to keep the trunk at the same level in the soil as it was before.