Yes, you can absolutely wear a kilt to a formal event. In Scotland (and among Scottish communities worldwide), a kilt outfit is considered highly appropriate formal wear.
For black-tie occasions, the traditional ensemble includes a Prince Charlie jacket, waistcoat, dress sporran, kilt hose, flashes, Ghillie brogues, and a bow tie. A fly plaid and sgian-dubh may also be added for extra formality. A well-presented kilt outfit is every bit as formal as a tuxedo.