Harassing another employee in the workplace is a definite no-no, but the rules may seem more blurry when it comes to interaction outside of the work. Whether alleged harassment of another employee outside of work will count against you -- and even result in a demotion or termination -- depends on your company's policy regarding these kinds of issues.
Most companies have a policy regarding harassment of another employee, no matter whether the incident takes place at work. This is because both parties' feelings about the incident can carry over into the work environment, affecting the parties involved and those around them. The person doing the harassing may also be disciplined according to company policy if the issue is carried over into the workplace because employees are considered company representatives.
Examples of harassment outside of the workplace that might result in termination include sexual harassment or assault, threatening actions or language toward a co-worker that might cause them to be uncomfortable in the work environment, courting personal favors using work-related tasks or responsibilities (wash my car or I'll make you organize the office supply room) or inappropriate language or advances that occur repeatedly. Even outside of work, these examples can carry over to the workplace, creating a hostile environment for the harassed employee.
If there is an accusation of harassment from one employee against another, the company must take action to avoid being accused of allowing a hostile work environment. This might mean an investigation into the matter, despite the fact that it occurred outside of work. Moreover, you can be terminated for harassing another person outside of work if your actions have occurred in a pattern over a period of time and are making the other person uncomfortable at the workplace.
Keep in mind that despite the fact that your personal time is your own, you are a representative for your company at all times. When you do things outside of work that reflect poorly on yourself as an individual and on the company as a whole, your bosses might find grounds to terminate your employment to spare the company the embarrassment of your actions. If you unsure of whether this applies to your employment situation, consult with human resources or read through the company handbook for additional information.