Machining PLA and PETG shouldn’t be any more dangerous than printing it. You’ll get a tiny about of gases and particulate matter airborne.
There is a long thread about lasering various materials, and PLA and PETG are discussed in various comments.
The tl;dr seems to be if you’re worried about it, vent the enclosure outside. Some people are worried about it, some people aren’t.