A vacuum cleaner will work without a filter although if you do use the vacuum cleaner without the filter installed it will almost always kick the dirt and dust back out of the vacuum cleaner and back into the room which would defeat the purpose of vacuuming the house in the first place.
I have used a shop vac without a filter before and it did okay although it did shoot out a little dust but I directed the shop vac out the window so that the dust went outside.
However I try to keep clean filters on hand now to use with my vacuum cleaners so that I can easily replace the filter with a new clean one while I'm cleaning the other dirty vacuum cleaner filter later.
With an upright vacuum cleaner the dust and dirt will likely just come out of the vacuum cleaner and into the room so it would not be a good idea to use the vacuum cleaner without a filter.