Yes, both hips can be replaced at the same time; this is called a bilateral hip replacement. Some advantages to the bilateral hip replacement include only having to go under general anesthetic once, a shorter overall hospital stay rather than two individual ones, and one rehabilitation. Drawbacks include that it can be harder to recover from two replacements at once, and some studies show a higher level of complications among patients with bilateral replacements.
Only your doctor can decide which is best for you.