Your coworkers might be right, but the timing alone doesn't automatically mean it's retaliation - you'd want to look at the actual pattern. That said, yes, you do have legal protections. The Occupational Safety and Health Act (OSH Act) specifically protects employees who report safety violations from being fired, demoted, threatened, or discriminated against because of that report. If your employer is suddenly writing you up for minor infractions you were never corrected for before, right after you reported OSHA violations, that's textbook retaliation.
The key is documenting everything from here on out. Keep copies of all those written warnings, note the dates you reported the violations and to whom, and write down what you were written up for and whether similar behavior went unaddressed before your report. If you can show a clear connection between your safety report and the negative treatment, you have a solid case. You should also file a retaliation complaint with OSHA within 30 days of the adverse action - they take this seriously and can investigate at no cost to you.
If you get fired, don't just walk away. File that retaliation complaint immediately, and consider reaching out to an employment lawyer who handles workplace safety issues. Many will do a free consultation, and some take cases on contingency. Your employer knows better than to retaliate, and the law gives you teeth here - use them.