The actual situation may differ from company to company but from the perspective of an employee it is probably wise to assume that the HR people are not 'on your side'. This also differs (strongly) from one country to another.
This especially goes for complaints about bullying or discrimination. Get a lawyer and a recruiter if it comes to that, but stay well away from HR. Your expenses might be investigated for anomalies.
Workers' unions can also be risky. They have their own agenda, leverage over management, and will encourage you to speak up often without considering your own best interests.