It is just like any NFL stadium. Most fans are polite; however, a lot of people drink too much, some are obnoxious and there are a handful of really bad fans. Our seats have been in the family since 1980 and most of the people who sit next to us are season ticket holders. I have never once seen a single problem in our section. But last year, during the Raiders preseason game, I saw a lot of fights in other sections.
The fact is, as someone who is not a season ticket holder, you will likely be getting the crummy seats near other 49ers fans that are not season ticket holders, and I suspect there is more probability of bad behavior in those areas.
For instance, I am looking on stub hub and the tickets in our section are about $500-700 per seat whereas the tickets near the end zone are less than $300, probably because a lot of them are owned by ticket brokers. I suspect that if there are areas of the stadium that experience trouble, those are it.
I have never seen anyone from the other team get severely harassed, and after the Raiders game, the amount of security in the parking lot is astronomical. Thanks to that incident, you have to go through metal detectors to get into the park and the SFPD comes en mass riding on their horses and motorcycles at kickoff to force everyone out of the parking lot.
So, to answer your question, usually you will not have any problems, but you might have the bad luck of sitting near a drunken idiot, so your mileage may vary, and the cheaper the seats, the more drunken idiots there are, just like any sports stadium in the world.
Just go to have a good time and if anyone hassles you, just turn and walk away or find one of the ridiculous numbers of SFPD officers that have patrolled the stadium since the last Raiders pre season game.