Which is grammatically correct? I'm not really sure how onomatopoeias work.

1. “Vroom!” the chainsaw took right off.
2. "Vroom!" The chainsaw took right off.
3. other?

Number 2 is grammatically correct. Since you have an end mark -- an exclamation point -- after "Vroom," the next sentence should start with a capital letter.

so it's ok that "Vroom!" is a fragment?

Yes, "Vroom!" is a fragment, but it's accepted in informal writing.

When it comes to punctuating onomatopoeias, there is flexibility in how they can be presented. However, in your example, both options 1 and 2 can be considered grammatically correct. The primary difference lies in the placement of the quotation mark before or after the exclamation mark. Let me explain further:

1. “Vroom!” the chainsaw took right off.
In this option, the quotation mark is placed outside of the exclamation mark. This style follows the typical convention where the quotation marks enclose the onomatopoeic sound, and the exclamation mark is used to emphasize it. It is commonly used in formal writing.

2. "Vroom!" The chainsaw took right off.
In this option, the quotation mark is placed inside of the exclamation mark. This style is also acceptable and commonly used in informal writing or creative contexts. Placing the quotation mark inside the exclamation mark can create a stronger visual impact and draw more attention to the sound.

Ultimately, the choice between these two options depends on your personal preference and the context in which you are writing.