We can declare and use static variables in a trigger, but we cannot use static initializer blocks.
A static variable defined in a trigger doesn’t retain its value between different trigger contexts within the same transaction, such as between before insert and after insert invocations.