If I fire drone at a planet or a vessel, is it considered hostile action?
Only if they hit something and deal damage.
So a geo-survey or other sensor rocket/satellite should be safe. . . but NPRs may have their point defense set to shoot down any foreign missile, not just known-hostile ones. So you might not get anything out of it.