During the summer, many Japanese people go to fireworks or bonodori festivals wearing a "yukata":
As a non-Japanese person going to such events, should I refrain from using a yukata? I'm worried it might be seen as insensitive.
As Imus has answered earlier, the (modern) expected dresscode for anyone is usually a yukata for summer festivals. This isn't always the case, especially for females, where yukatas can be considered stuffy or a trouble to put on. As an example that this is the general view, here's a small comparison on preferences that was trending a few years back, on the subject of a female companion's preference of dress code to a summer festival.
From personal experience, I was actually encouraged to wear one, complete with wooden getas (as well as to trips to onsen). Even though my Japanese is at best daily conversational level, a very helpful innlady was happy to help me put on the wear, which was already included in the lodging fee. I was travelling with other foreigner friends, so I wasn't with a group of natives, either. I got to meet and befriend a group of travelling local students as well, and they seemed to not mind the wear, and probably expected it.
I would conclude that it is fine to wear yukatas to summer events, and that it's not really seen as a faux pas if its a foreigner wearing it.
Edit: I would like to add, though, that wearing it sloppily is probably a greater faux pas than actually wearing it. Make sure you get help from someone that knows the intricacies (ideally), or read up on the subject carefully. For example, using the wrong side on top can be culturally inappropriate because of funeral ceremonies, and the way you tie your obi can really tell how sloppy or not you're treating the dresscode.
Starting from the culturally expected dresscode at these kind of events wearing a yukata is the most "normal" thing to do. Just like wearing a black (or really dark) suit to a funeral or a tuxedo to a wedding would be the expected dress code.
If a foreigner shows up with the "culturally correct" clothes it's most likely percieved as appreciation for the culture. You're showing interest in the culture and try to fit in.
On the other hand, if you show up in "normal western" clothing instead you'll just be seen as that foreigner that likes the fireworks. Nothing wrong here either.
So although it's not really expected of foreingers you're not doing anything wrong either if you decide to show up in the culturally expected clothing.
If you happen to have Japanese friends you can also go a step further and ask them if you wore that yukata correctly or if there are some nuances that you might not know about. Similarly to how you leave the bottom button open in a suit jacket for example.
Mostly with Japanese friends
As you have Japanese friends, would it not be an idea to see what their take is on the matter? I'm sure they'd be glad to give you pointers on what would be considered appropriate.
This is an event, a celebration and a joyful time, there's no clear restrictions on who can or can't attend nor what wear is considered to be acceptable. Granted, Japan has it's own cultural beliefs etc- however you wouldn't be asking if this was obvious, as such, I see no harm in it.
I can't speak from experience with Japan in particular- but all the same, around the rest of the world there's a plethora of events that could be considered to be "culture-specific" in terms of their origin and celebratory focus- but this has never excluded them from being attended by "only X-culture".
Has it stopped me from celebrating the 4th of July with Americans, despite being half English and half Australian, living in the UK? No. Do I participate in Anzac Day? Yes. Octoberfest, marathons, charity events etc- yes to all. There's nothing barring you from joining in and participating in the spirit of the event any more than there is stopping you from wearing a Yukata.
Enjoy yourself, with others and have a pleasant time. That's what these events are for- you're just immersing yourself in and joining in by attending and wearing it.
tl:dr of it is- yes. Wear it! Enjoy it.